]> git.lizzy.rs Git - rust.git/log
rust.git
11 years agoAdd x64 windows to platform.mk and mingw64 header fixes.
Luqman Aden [Thu, 4 Jul 2013 03:33:59 +0000 (23:33 -0400)]
Add x64 windows to platform.mk and mingw64 header fixes.

11 years agoforce LLVM clean
Daniel Micay [Thu, 4 Jul 2013 03:23:29 +0000 (23:23 -0400)]
force LLVM clean

11 years agoauto merge of #7542 : alexcrichton/rust/patch-rusti, r=cmr
bors [Thu, 4 Jul 2013 00:40:56 +0000 (17:40 -0700)]
auto merge of #7542 : alexcrichton/rust/patch-rusti, r=cmr

Doesn't disable it completely, also removes the bogus `rc` file.

11 years agoauto merge of #7534 : bblum/rust/soundness-messages, r=catamorphism
bors [Wed, 3 Jul 2013 22:25:55 +0000 (15:25 -0700)]
auto merge of #7534 : bblum/rust/soundness-messages, r=catamorphism

11 years agoauto merge of #7566 : huonw/rust/vec-kill, r=cmr
bors [Wed, 3 Jul 2013 15:16:54 +0000 (08:16 -0700)]
auto merge of #7566 : huonw/rust/vec-kill, r=cmr

The last remaining internal iterator in `vec` is `each_permutation`.

11 years agoConvert vec::{as_imm_buf, as_mut_buf} to methods.
Huon Wilson [Wed, 3 Jul 2013 06:34:17 +0000 (16:34 +1000)]
Convert vec::{as_imm_buf, as_mut_buf} to methods.

11 years agoConvert vec::windowed to an external iterator, and add an n-at-a-time chunk iterator.
Huon Wilson [Wed, 3 Jul 2013 05:47:58 +0000 (15:47 +1000)]
Convert vec::windowed to an external iterator, and add an n-at-a-time chunk iterator.

11 years agoConvert vec::{split, splitn, rsplit, rsplitn} to external iterators.
Huon Wilson [Wed, 3 Jul 2013 04:54:11 +0000 (14:54 +1000)]
Convert vec::{split, splitn, rsplit, rsplitn} to external iterators.

11 years agoRemove standalone comparison functions in vec, make the trait impls better.
Huon Wilson [Wed, 3 Jul 2013 02:13:00 +0000 (12:13 +1000)]
Remove standalone comparison functions in vec, make the trait impls better.

11 years agoRemove vec::reversed, replaced by iterators.
Huon Wilson [Tue, 2 Jul 2013 02:58:23 +0000 (12:58 +1000)]
Remove vec::reversed, replaced by iterators.

11 years agoRemove vec::{filter, filtered, filter_map, filter_mapped}, replaced by iterators.
Huon Wilson [Tue, 2 Jul 2013 02:38:19 +0000 (12:38 +1000)]
Remove vec::{filter, filtered, filter_map, filter_mapped}, replaced by iterators.

11 years agoImplement consuming iterators for ~[], remove vec::{consume, consume_reverse, map_con...
Huon Wilson [Mon, 1 Jul 2013 15:26:44 +0000 (01:26 +1000)]
Implement consuming iterators for ~[], remove vec::{consume, consume_reverse, map_consume}.

11 years agoauto merge of #7531 : sankha93/rust/master, r=bblum
bors [Wed, 3 Jul 2013 13:34:56 +0000 (06:34 -0700)]
auto merge of #7531 : sankha93/rust/master, r=bblum

This pull request fixes #7118.

11 years agoauto merge of #7523 : huonw/rust/uppercase-statics-lint, r=cmr
bors [Wed, 3 Jul 2013 11:31:50 +0000 (04:31 -0700)]
auto merge of #7523 : huonw/rust/uppercase-statics-lint, r=cmr

Adds a lint for `static some_lowercase_name: uint = 1;`. Warning by default since it causes confusion, e.g. `static a: uint = 1; ... let a = 2;` => `error: only refutable patterns allowed here`.

11 years agoauto merge of #7518 : graydon/rust/stats-improvements, r=catamorphism
bors [Wed, 3 Jul 2013 09:49:51 +0000 (02:49 -0700)]
auto merge of #7518 : graydon/rust/stats-improvements, r=catamorphism

11 years agoauto merge of #7474 : Seldaek/rust/clean-iter, r=thestinger
bors [Wed, 3 Jul 2013 08:07:55 +0000 (01:07 -0700)]
auto merge of #7474 : Seldaek/rust/clean-iter, r=thestinger

I think it's WIP - but I wanted to ask for feedback (/cc @thestinger)

I had to move the impl of FromIter for vec into extra::iter because I don't think std can depend on extra, but that's a bit messed up. Similarly some FromIter uses are gone now, not sure if this is fixable or if I made a complete mess here..

11 years agoauto merge of #7510 : Dretch/rust/missing-trait-message, r=catamorphism
bors [Wed, 3 Jul 2013 05:40:56 +0000 (22:40 -0700)]
auto merge of #7510 : Dretch/rust/missing-trait-message, r=catamorphism

11 years agoauto merge of #7498 : luqmana/rust/cow, r=catamorphism
bors [Wed, 3 Jul 2013 03:58:57 +0000 (20:58 -0700)]
auto merge of #7498 : luqmana/rust/cow, r=catamorphism

Either one works and wget is easier to setup on windows.

11 years agoMerge pull request #7187 from nikomatsakis/issue-3238-defer-reasoning-about-regions
Daniel Micay [Tue, 2 Jul 2013 21:32:21 +0000 (14:32 -0700)]
Merge pull request #7187 from nikomatsakis/issue-3238-defer-reasoning-about-regions

Defer reasoning about regions until after regionck

11 years agodoc: Update links to 0.7
Brian Anderson [Tue, 2 Jul 2013 16:25:44 +0000 (09:25 -0700)]
doc: Update links to 0.7

11 years agoCompletely disable rusti on 32-bit hosts
Alex Crichton [Tue, 2 Jul 2013 01:39:27 +0000 (18:39 -0700)]
Completely disable rusti on 32-bit hosts

11 years agoIgnore all rusti tests harder. #7541
Brian Anderson [Tue, 2 Jul 2013 04:23:36 +0000 (21:23 -0700)]
Ignore all rusti tests harder. #7541

11 years agoIgnore all rusti tests. #7541
Brian Anderson [Tue, 2 Jul 2013 01:33:45 +0000 (18:33 -0700)]
Ignore all rusti tests. #7541

11 years agoCorrect merge errors, broken tests
Niko Matsakis [Tue, 2 Jul 2013 00:43:42 +0000 (20:43 -0400)]
Correct merge errors, broken tests

11 years agoAdd copyright notice and kill broken test
Niko Matsakis [Wed, 19 Jun 2013 16:32:56 +0000 (12:32 -0400)]
Add copyright notice and kill broken test

11 years agoAdjust documentation to describe how closures and closure bounds
Niko Matsakis [Sun, 16 Jun 2013 18:03:35 +0000 (14:03 -0400)]
Adjust documentation to describe how closures and closure bounds
affect things.

11 years agoMove existing docs into doc.rs
Niko Matsakis [Thu, 6 Jun 2013 15:58:34 +0000 (11:58 -0400)]
Move existing docs into doc.rs

11 years agoconvert region_inference into a module, so I can attach docs
Niko Matsakis [Thu, 6 Jun 2013 15:57:37 +0000 (11:57 -0400)]
convert region_inference into a module, so I can attach docs

11 years agomove docs into doc.rs
Niko Matsakis [Thu, 6 Jun 2013 01:17:07 +0000 (21:17 -0400)]
move docs into doc.rs

11 years agoCorrect handling of if/match, and make explicit computation of
Niko Matsakis [Thu, 6 Jun 2013 01:04:07 +0000 (21:04 -0400)]
Correct handling of if/match, and make explicit computation of
common supertypes.

This was breaking with the change to regions because of the
(now incorrect) assumpton that our inference code makes,
which is that if a <: b succeeds, there is no need to compute
the LUB/GLB.

11 years agoDefer reasoning about region relationships until after regionck.
Niko Matsakis [Fri, 24 May 2013 01:37:37 +0000 (21:37 -0400)]
Defer reasoning about region relationships until after regionck.

This patch makes error handling for region inference failures more
uniform by not reporting *any* region errors until the reigon inference
step. This requires threading through more information about what
caused a region constraint, so that we can still give informative
error messages.

I have only taken partial advantage of this information: when region
inference fails, we still report the same error we always did, despite
the fact that we now know precisely what caused the various constriants
and what the region variable represents, which we did not know before.

This change is required not only to improve error messages but
because the region hierarchy is not in fact fully known until regionck,
because it is not clear where closure bodies fit in (our current
treatment is unsound). Moreover, the relationships between free variables
cannot be fully determined until type inference is otherwise complete.

cc #3238.

11 years agoAdd a run-pass test for recursive copyable stack closures.
Ben Blum [Mon, 1 Jul 2013 22:05:46 +0000 (18:05 -0400)]
Add a run-pass test for recursive copyable stack closures.

11 years agoFix filenames of some compile-fail tests.
Ben Blum [Mon, 1 Jul 2013 19:54:54 +0000 (15:54 -0400)]
Fix filenames of some compile-fail tests.

11 years agoBetter error messages in report_use_of_moved_value; close #7286
Ben Blum [Mon, 1 Jul 2013 19:38:57 +0000 (15:38 -0400)]
Better error messages in report_use_of_moved_value; close #7286

11 years agoImprove the attempted dynamic environment-capture error message
Sankha Narayan Guria [Mon, 1 Jul 2013 17:47:43 +0000 (23:17 +0530)]
Improve the attempted dynamic environment-capture error message

11 years agoauto merge of #7409 : alexcrichton/rust/threadsafe, r=cmr
bors [Mon, 1 Jul 2013 18:29:24 +0000 (11:29 -0700)]
auto merge of #7409 : alexcrichton/rust/threadsafe, r=cmr

@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.

11 years agoTurn on using LLVM threadsafely
Alex Crichton [Wed, 26 Jun 2013 06:46:26 +0000 (23:46 -0700)]
Turn on using LLVM threadsafely

11 years agoauto merge of #7488 : yichoi/rust/sanitize_utf8, r=huonw
bors [Mon, 1 Jul 2013 15:03:15 +0000 (08:03 -0700)]
auto merge of #7488 : yichoi/rust/sanitize_utf8, r=huonw

back::link::sanitize support escape_utf8
fix #7486

11 years agoauto merge of #7443 : yjh0502/rust/fix_field_dup, r=huonw
bors [Mon, 1 Jul 2013 11:37:59 +0000 (04:37 -0700)]
auto merge of #7443 : yjh0502/rust/fix_field_dup, r=huonw

Check if there is duplicated field names in struct.

11 years agoauto merge of #7521 : thestinger/rust/vec, r=Aatch
bors [Mon, 1 Jul 2013 09:26:46 +0000 (02:26 -0700)]
auto merge of #7521 : thestinger/rust/vec, r=Aatch

continued from #7495

11 years agorustc: add a lint to enforce uppercase statics.
Huon Wilson [Mon, 1 Jul 2013 03:51:13 +0000 (13:51 +1000)]
rustc: add a lint to enforce uppercase statics.

11 years agolint: make the non_camel_case_types lint work with scripts without a upper/lowercase...
Huon Wilson [Mon, 1 Jul 2013 03:50:39 +0000 (13:50 +1000)]
lint: make the non_camel_case_types lint work with scripts without a upper/lowercase distinction.

11 years agoauto merge of #7492 : yichoi/rust/fix_cleanllvm, r=luqmana
bors [Mon, 1 Jul 2013 07:14:02 +0000 (00:14 -0700)]
auto merge of #7492 : yichoi/rust/fix_cleanllvm, r=luqmana

fix clean-llvm in mk/clean.mk for cross-compile

after #7442 landed, below error produced while android cross-compile
```
make[1]: *** No rule to make target `clean-llvmarm-linux-androideabi', needed by `clean-llvm'.  Stop.
make[1]: Leaving directory `/home/yichoi/rust_latest/build'
make: *** [rustllvm/llvm-auto-clean-stamp] Error 2
```

11 years agolibrustc: apply changes of char::escape_unicode
Young-il Choi [Mon, 1 Jul 2013 07:11:32 +0000 (16:11 +0900)]
librustc: apply changes of char::escape_unicode

11 years agolibrustc: back::link::sanitize support esacpe_utf8
Young-il Choi [Sun, 30 Jun 2013 13:15:03 +0000 (22:15 +0900)]
librustc: back::link::sanitize support esacpe_utf8

11 years agoauto merge of #7487 : huonw/rust/vec-kill, r=cmr
bors [Mon, 1 Jul 2013 04:14:13 +0000 (21:14 -0700)]
auto merge of #7487 : huonw/rust/vec-kill, r=cmr

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.

11 years agoUpdate verison numbers in README.md
Brian Anderson [Mon, 1 Jul 2013 04:08:48 +0000 (21:08 -0700)]
Update verison numbers in README.md

11 years agopass exchange_malloc an alignment, not a tydesc
Daniel Micay [Mon, 1 Jul 2013 03:30:40 +0000 (23:30 -0400)]
pass exchange_malloc an alignment, not a tydesc

11 years agoglobal_heap: inline get_box_size and align_to
Daniel Micay [Mon, 1 Jul 2013 02:41:51 +0000 (22:41 -0400)]
global_heap: inline get_box_size and align_to

11 years agovec: implement exchange vector reserve in Rust
Daniel Micay [Mon, 1 Jul 2013 02:18:17 +0000 (22:18 -0400)]
vec: implement exchange vector reserve in Rust

11 years agoglobal_heap: inline malloc_raw and add realloc_raw
Daniel Micay [Mon, 1 Jul 2013 02:12:26 +0000 (22:12 -0400)]
global_heap: inline malloc_raw and add realloc_raw

11 years agoauto merge of #7517 : brson/rust/0.7, r=brson
bors [Mon, 1 Jul 2013 00:34:58 +0000 (17:34 -0700)]
auto merge of #7517 : brson/rust/0.7, r=brson

11 years agoextra: docs, tests and new functionality for the extra::stats module
Graydon Hoare [Mon, 1 Jul 2013 00:34:23 +0000 (17:34 -0700)]
extra: docs, tests and new functionality for the extra::stats module

11 years agoMove most iter functionality to extra, fixes #7343
Jordi Boggiano [Sat, 29 Jun 2013 02:09:58 +0000 (04:09 +0200)]
Move most iter functionality to extra, fixes #7343

11 years agoAdd an EnumSetIterator and EnumSet::iter
Jordi Boggiano [Sun, 30 Jun 2013 18:12:04 +0000 (20:12 +0200)]
Add an EnumSetIterator and EnumSet::iter

11 years agoBump version from 0.7-pre to 0.7
Brian Anderson [Sun, 30 Jun 2013 23:36:48 +0000 (16:36 -0700)]
Bump version from 0.7-pre to 0.7

11 years agoMore 0.7 release notes
Brian Anderson [Sun, 30 Jun 2013 22:02:52 +0000 (15:02 -0700)]
More 0.7 release notes

11 years agoauto merge of #7495 : thestinger/rust/exchange, r=cmr
bors [Sun, 30 Jun 2013 22:02:05 +0000 (15:02 -0700)]
auto merge of #7495 : thestinger/rust/exchange, r=cmr

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.

11 years agoWhen an impl references an unknown trait, mention what
gareth [Sun, 30 Jun 2013 20:43:53 +0000 (21:43 +0100)]
When an impl references an unknown trait, mention what
the trait is called in the error message.

11 years agoadd a closure_exchange_malloc lang item
Daniel Micay [Sun, 30 Jun 2013 07:22:18 +0000 (03:22 -0400)]
add a closure_exchange_malloc lang item

this makes the exchange allocation header completely unused, and leaves
it uninitialized

11 years agostop copying the tydesc in unique box take glue
Daniel Micay [Sun, 30 Jun 2013 04:49:57 +0000 (00:49 -0400)]
stop copying the tydesc in unique box take glue

the only user of the tydesc is ~fn, and it doesn't use this glue code

11 years agomanaged: rm RC_EXCHANGE_UNIQUE constant
Daniel Micay [Sun, 30 Jun 2013 04:30:19 +0000 (00:30 -0400)]
managed: rm RC_EXCHANGE_UNIQUE constant

this is no longer used, exchange allocations do not set ref_count

11 years agostop initializing ref_count in exchange_alloc
Daniel Micay [Sun, 30 Jun 2013 03:08:00 +0000 (23:08 -0400)]
stop initializing ref_count in exchange_alloc

this is never read anymore

11 years agorustpkg: Ignore a test that's failing on the dist-snap bot
Brian Anderson [Sun, 30 Jun 2013 20:12:15 +0000 (13:12 -0700)]
rustpkg: Ignore a test that's failing on the dist-snap bot

11 years agoauto merge of #7465 : alexcrichton/rust/issue-4432, r=cmr
bors [Sun, 30 Jun 2013 16:32:01 +0000 (09:32 -0700)]
auto merge of #7465 : alexcrichton/rust/issue-4432, r=cmr

This stems from trying to perform as few allocations as possible throughout the standard libraries.

This specializes the `ToStr` implementation for floats/ints separately because it's known that ints will have a maximum length (whereas floats could be very very large).

I also removed a `FIXME` to remove a malloc from the `to_str()` of floats in `repr.rs` because I think that this should be addressed elsewhere. I think that we may not be able to avoid it easily because floats can have such large representations, but regardless this should be a problem with the implementation of `float_to_str_bytes_common` now and not in the `Repr` module.

11 years agoSpecialize to_str_common for floats/integers in strconv
Alex Crichton [Fri, 28 Jun 2013 21:05:10 +0000 (14:05 -0700)]
Specialize to_str_common for floats/integers in strconv

This allows the integral paths to avoid allocations on the heap

Closes #4424, #4423

11 years agoChange char::escape_{default,unicode} to take callbacks instead of allocating
Alex Crichton [Fri, 28 Jun 2013 21:04:13 +0000 (14:04 -0700)]
Change char::escape_{default,unicode} to take callbacks instead of allocating
strings

11 years agoRemove vec::{map, mapi, zip_map} and the methods, except for .map, since this
Huon Wilson [Sat, 29 Jun 2013 05:05:50 +0000 (15:05 +1000)]
Remove vec::{map, mapi, zip_map} and the methods, except for .map, since this
is very common, and the replacement (.iter().transform().collect()) is very
ugly.

11 years agoauto merge of #7374 : Jeaye/rust/func_highlight, r=cmr
bors [Sun, 30 Jun 2013 11:40:37 +0000 (04:40 -0700)]
auto merge of #7374 : Jeaye/rust/func_highlight, r=cmr

This allows for highlighting of function calls
for free floating, member, and static functions.

11 years agoConvert vec::{grow, grow_fn, grow_set} to methods.
Huon Wilson [Sat, 29 Jun 2013 04:02:20 +0000 (14:02 +1000)]
Convert vec::{grow, grow_fn, grow_set} to methods.

11 years agoConvert vec::dedup to a method.
Huon Wilson [Sat, 29 Jun 2013 03:41:09 +0000 (13:41 +1000)]
Convert vec::dedup to a method.

11 years agoConvert vec::{bsearch, bsearch_elem} to methods.
Huon Wilson [Sat, 29 Jun 2013 03:35:25 +0000 (13:35 +1000)]
Convert vec::{bsearch, bsearch_elem} to methods.

11 years agoetc: update etc/unicode.py for the changes made to std::unicode.
Huon Wilson [Sat, 29 Jun 2013 01:19:14 +0000 (11:19 +1000)]
etc: update etc/unicode.py for the changes made to std::unicode.

11 years agoConvert vec::{reverse, swap} to methods.
Huon Wilson [Fri, 28 Jun 2013 16:54:03 +0000 (02:54 +1000)]
Convert vec::{reverse, swap} to methods.

11 years agoConvert vec::{rposition, rposition_elem, position_elem, contains} to methods.
Huon Wilson [Fri, 28 Jun 2013 16:08:32 +0000 (02:08 +1000)]
Convert vec::{rposition, rposition_elem, position_elem, contains} to methods.

11 years agoRemove vec::[r]position_between, replaced by slices & iterators.
Huon Wilson [Fri, 28 Jun 2013 15:33:23 +0000 (01:33 +1000)]
Remove vec::[r]position_between, replaced by slices & iterators.

11 years agoRemove vec::{rfind, rfind_between, find_between}, replaced by slices and iterator...
Huon Wilson [Fri, 28 Jun 2013 14:59:41 +0000 (00:59 +1000)]
Remove vec::{rfind, rfind_between, find_between}, replaced by slices and iterator adapators.

11 years agoauto merge of #7468 : cmr/rust/great_renaming, r=pcwalton
bors [Sun, 30 Jun 2013 08:19:38 +0000 (01:19 -0700)]
auto merge of #7468 : cmr/rust/great_renaming, r=pcwalton

11 years agovec: use contains_managed instead of box header
Daniel Micay [Sun, 30 Jun 2013 02:40:40 +0000 (22:40 -0400)]
vec: use contains_managed instead of box header

11 years agoadd a contains_managed intrinsic
Daniel Micay [Sun, 30 Jun 2013 02:36:27 +0000 (22:36 -0400)]
add a contains_managed intrinsic

11 years agosimplify the exchange allocator
Daniel Micay [Sun, 30 Jun 2013 02:35:04 +0000 (22:35 -0400)]
simplify the exchange allocator

* stop using an atomic counter, this has a significant cost and
  valgrind will already catch these leaks
* remove the extra layer of function calls
* remove the assert of non-null in free, freeing null is well defined
  but throwing a failure from free will not be
* stop initializing the `prev`/`next` pointers
* abort on out-of-memory, failing won't necessarily work

11 years agoauto merge of #7490 : mozilla/rust/rollup, r=thestinger
bors [Sun, 30 Jun 2013 06:34:43 +0000 (23:34 -0700)]
auto merge of #7490 : mozilla/rust/rollup, r=thestinger

603137c r=cmr
fe10db2 r=bstrie

11 years agoconfigure: Require one of wget or curl.
Luqman Aden [Sun, 30 Jun 2013 02:22:20 +0000 (22:22 -0400)]
configure: Require one of wget or curl.

11 years agoauto merge of #7475 : Seldaek/rust/fixsplit, r=cmr
bors [Sun, 30 Jun 2013 04:13:31 +0000 (21:13 -0700)]
auto merge of #7475 : Seldaek/rust/fixsplit, r=cmr

I almost got locked out of my machine because I misunderstood the purpose of the function and called it with a limit of uint::max_value, which turned this function into an almost endless loop.

11 years agomk: clean-llvm for cross-compile
Young-il Choi [Sun, 30 Jun 2013 03:54:17 +0000 (12:54 +0900)]
mk: clean-llvm for cross-compile

11 years agoauto merge of #7457 : Blei/rust/fix-ffi-floats, r=cmr
bors [Sun, 30 Jun 2013 01:40:33 +0000 (18:40 -0700)]
auto merge of #7457 : Blei/rust/fix-ffi-floats, r=cmr

Also contains a fix to help ctag pick up macro definitions.

11 years agoFixes #7377
jihyun [Fri, 28 Jun 2013 00:27:56 +0000 (09:27 +0900)]
Fixes #7377

11 years agoauto merge of #7452 : dotdash/rust/self_indirection, r=cmr
bors [Sat, 29 Jun 2013 23:46:32 +0000 (16:46 -0700)]
auto merge of #7452 : dotdash/rust/self_indirection, r=cmr

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

11 years agominor vec cleanup
Daniel Micay [Sat, 29 Jun 2013 03:44:55 +0000 (23:44 -0400)]
minor vec cleanup

* hide the rustrt module in the docs
* remove the useless `traits` module wrapping the `Add` impl

11 years agoAdd -v/--version support to rust binary
Jordi Boggiano [Fri, 28 Jun 2013 18:34:06 +0000 (20:34 +0200)]
Add -v/--version support to rust binary

11 years agofix code block syntax in two docstrings
Daniel Micay [Sat, 29 Jun 2013 06:43:51 +0000 (02:43 -0400)]
fix code block syntax in two docstrings

11 years agoauto merge of #7449 : yichoi/rust/std_test, r=cmr
bors [Sat, 29 Jun 2013 21:31:41 +0000 (14:31 -0700)]
auto merge of #7449 : yichoi/rust/std_test, r=cmr

adjust run.rs test for android to pass check std

11 years agoauto merge of #7342 : alexcrichton/rust/assort-cleanup, r=cmr
bors [Sat, 29 Jun 2013 19:02:05 +0000 (12:02 -0700)]
auto merge of #7342 : alexcrichton/rust/assort-cleanup, r=cmr

This removes usage of `&const` throughout the standard libraries/compiler, and it removes some extraneous fields in the AST now that unique boxes always inherit their mutability.

11 years agoAvoid double indirection for the "self" arg in methods
Björn Steinbrink [Thu, 27 Jun 2013 23:40:27 +0000 (01:40 +0200)]
Avoid double indirection for the "self" arg in methods

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

11 years agoFix handling of temp cleanups for the "self" argument
Björn Steinbrink [Sat, 29 Jun 2013 15:45:59 +0000 (17:45 +0200)]
Fix handling of temp cleanups for the "self" argument

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.

11 years agoRemove mutability from unique boxes in the AST
Alex Crichton [Mon, 24 Jun 2013 04:12:17 +0000 (21:12 -0700)]
Remove mutability from unique boxes in the AST

11 years agoRemoving a lot of usage of '&const'
Alex Crichton [Mon, 24 Jun 2013 03:44:11 +0000 (20:44 -0700)]
Removing a lot of usage of '&const'

11 years agoWarning cleanup
Corey Richardson [Sat, 29 Jun 2013 15:01:25 +0000 (11:01 -0400)]
Warning cleanup

11 years agoFix merge fallout
Corey Richardson [Sat, 29 Jun 2013 10:11:14 +0000 (06:11 -0400)]
Fix merge fallout

11 years agoGreat renaming: propagate throughout the rest of the codebase
Corey Richardson [Fri, 28 Jun 2013 22:32:26 +0000 (18:32 -0400)]
Great renaming: propagate throughout the rest of the codebase