Commit graph

18666 commits

Author SHA1 Message Date
bors
b50030718c auto merge of #6927 : jld/rust/monomorphize-abi-alignment, r=sanxiyn 2013-06-04 02:10:33 -07:00
Jed Davis
0c9510ac38 Use ABI alignment, not "preferred" alignment, to unify monomorphizations.
See the comment in the added test case for details.
2013-06-04 00:18:48 -07:00
bors
133d451715 auto merge of #6886 : jld/rust/vec-each-ret-fix, r=sanxiyn 2013-06-03 18:55:29 -07:00
bors
af418f2fd5 auto merge of #6924 : msullivan/rust/incoming, r=pcwalton 2013-06-03 17:28:33 -07:00
Michael Sullivan
d85938f7c8 Make type_is_pod handle structs correctly. Closes #6868. 2013-06-03 17:16:12 -07:00
bors
13aa18891c auto merge of #6910 : Blei/rust/fix-6698, r=pcwalton
Fixes #6698
2013-06-03 15:40:29 -07:00
bors
846545a6e1 auto merge of #6907 : steveklabnik/rust/prelude_docs, r=graydon 2013-06-03 14:37:39 -07:00
bors
8a43b318bf auto merge of #6826 : cmr/rust/terminfo, r=thestinger
This will let *everyone* (non-windows, at least) who can see colors see the glorious colors rustc produces.
2013-06-03 13:34:56 -07:00
Corey Richardson
ae5f3de5f0 Ignore tests that cannot pass on buildbot 2013-06-03 16:05:46 -04:00
bors
c68c015798 auto merge of #6906 : catamorphism/rust/rustpkg-doc, r=graydon
r? @graydon
2013-06-03 12:32:05 -07:00
Steve Klabnik
fe70361bb6 Add better documentation for the Prelude. 2013-06-03 11:49:06 -07:00
bors
5ddbc881c5 auto merge of #6913 : thestinger/rust/ptr, r=graydon
Closes #6607

I went with `RawPtr` instead of `UnsafePtr` because not all of these operations are `unsafe`, so to me it makes more sense to refer to it as a "raw" (not wrapped/abstracted) pointer. If we decide on something else in #6608 it can be renamed again.
2013-06-03 11:38:09 -07:00
Daniel Micay
e900dba28a rename the Ptr trait to RawPtr
Closes #6607
2013-06-03 13:50:29 -04:00
Philipp Brüschweiler
394ac1aae4 resolve: don't resolve paths that point to non-static methods
Fixes #6698
2013-06-03 13:31:43 +02:00
Philipp Brüschweiler
45441e046b Add test for issue #6698 2013-06-03 13:09:26 +02:00
bors
4f6285fbf9 auto merge of #6903 : dotdash/rust/self_by_value, r=catamorphism
For types that are passed by value, we can't just cast the value to a
pointer, but have to use an alloca and copy the value there. This
handling is already present for all other arguments, but was missing
for "self".

Fixes #6682 #4850 #4878
2013-06-02 22:31:36 -07:00
bors
9b60ecc30e auto merge of #6908 : bjz/rust/concat-connect, r=Aatch
This adds the following traits to `prelude`:

In `std::str`, impled on `&[~[T]]` and `&[&[T]]`:
~~~rust
pub trait StrVector {
    pub fn concat(&self) -> ~str;
    pub fn connect(&self, sep: &str) -> ~str;
}
~~~

In `std::vec`, impled on `&[~str]` and `&[&str]`:
~~~rust
pub trait VectorVector<T> {
    pub fn concat(&self) -> ~[T];
    pub fn connect(&self, sep: &T) -> ~[T];
}
~~~
2013-06-02 21:37:38 -07:00
Brendan Zabarauskas
dee7c5af69 Add traits for concat and connect methods 2013-06-03 13:19:37 +10:00
Tim Chevalier
5b09dca90b docs: Mention recently-added rustpkg features in the rustpkg manual 2013-06-02 17:21:01 -07:00
bors
c40baf68cb auto merge of #6905 : thestinger/rust/ptr, r=catamorphism
The ptr module is intended to be for raw pointers.

Closes #3111
2013-06-02 16:55:33 -07:00
Daniel Micay
454133127a ptr: split out borrowed pointer utilities
The ptr module is intended to be for raw pointers.

Closes #3111
2013-06-02 19:24:33 -04:00
bors
dad945646f auto merge of #6879 : yichoi/rust/arm-test, r=brson
Fix #6353 and better support for ARM Test
2013-06-02 15:49:30 -07:00
Björn Steinbrink
b51f44e21b Fix passing self by value for types passed by value
For types that are passed by value, we can't just cast the value to a
pointer, but have to use an alloca and copy the value there. This
handling is already present for all other arguments, but was missing
for "self".

Fixes #6682, #4850 and #4878
2013-06-03 00:06:09 +02:00
bors
63b11e48e5 auto merge of #6866 : pcwalton/rust/pub-extern, r=brson
r? @brson
2013-06-02 14:55:33 -07:00
bors
077ca79941 auto merge of #6867 : Dretch/rust/hashmap_get_mut, r=nikomatsakis 2013-06-02 09:16:40 -07:00
gareth
d443fc6d90 Add a get_mut method to accompany the get method. 2013-06-02 16:22:43 +01:00
bors
c354a0c7eb auto merge of #6896 : nickdesaulniers/rust/issue4501, r=brson
review? @brson
2013-06-01 22:37:35 -07:00
bors
14c331053e auto merge of #6815 : kballard/rust/hashmap-insert_or_modify_with, r=erickt
`std::hashmap::HashMap.insert_or_update_with()` is basically the opposite
of `find_or_insert_with()`. It inserts a given key-value pair if the key
does not already exist, or replaces the existing value with the output
of the passed function if it does.

This is useful because replicating this with existing functionality is awkward, especially with the current borrow-checker. In my own project I have code that looks like

	if match map.find_mut(&key) {
		None => { true }
		Some(x) => { *x += 1; false }
	} {
		map.insert(key, 0);
	}

and it took several iterations to make it look this good. The new function turns this into

    map.insert_or_update_with(key, 0, |_,x| *x += 1);
2013-06-01 21:31:36 -07:00
bors
96f6f29477 auto merge of #6891 : luqmana/rust/unit-struct-drop, r=catamorphism 2013-06-01 20:16:39 -07:00
Luqman Aden
101e3872fe Mark run-pass/unit-like-struct-drop-run.rs as xfast-fail. 2013-06-01 22:35:55 -04:00
bors
fc5debd8fd auto merge of #6807 : catamorphism/rust/rustpkg-extern-mod, r=catamorphism
r? @graydon Addresses #5681
2013-06-01 19:22:42 -07:00
Tim Chevalier
60126e9365 testsuite: Add an xfailed test case for the new extern mod syntax 2013-06-01 18:48:07 -07:00
Tim Chevalier
c120464be0 rustc/rusti/rustpkg: Infer packages from extern mod directives
This commit won't be quite as useful until I implement RUST_PATH and
until we change `extern mod` to take a general string instead of
an identifier (#5682 and #6407).

With that said, now if you're using rustpkg and a program contains:

extern mod foo;

rustpkg will attempt to search for `foo`, so that you don't have to
provide a -L directory explicitly. In addition, rustpkg will
actually try to build and install `foo`, unless it's already
installed (specifically, I tested that `extern mod extra;` would
not cause it to try to find source for `extra` and compile it
again).

This is as per #5681.

Incidentally, I changed some driver code to infer the link name
from the crate link_meta attributes. If that change isn't ok, say
something. Also, I changed the addl_lib_search_paths field in the
session options to be an @mut ~[Path] so that it can be modified
after expansion but before later phases.
2013-06-01 18:48:07 -07:00
Tim Chevalier
341678b815 rustc: Call str::is_empty 2013-06-01 18:48:07 -07:00
Tim Chevalier
760c71dc4f syntax: Add an each_view_item method on traits 2013-06-01 18:48:07 -07:00
Tim Chevalier
231aea6d6e rustc: Improve astconv error message 2013-06-01 18:48:07 -07:00
Nick Desaulniers
ecd08b989a Swap return value of pipes::init Fixes #4501 2013-06-01 18:19:16 -07:00
Kevin Ballard
75f1b7f96f Add new function hashmap.insert_or_update_with()
fn insert_or_update_with<'a>(&'a mut self,
                             k: K,
                             f: &fn(&K, &mut V)) -> &'a V
2013-06-01 17:38:24 -07:00
Kevin Ballard
7bc950c43c Refactor some hashmap code into a new private function mangle()
Add new private hashmap function

    fn mangle(&mut self,
              k: K,
              not_found: &fn(&K) -> V,
              found: &fn(&K, &mut V)) -> uint

Rewrite find_or_insert() and find_or_insert_with() on top of mangle().

Also take the opportunity to change the return type of find_or_insert()
and find_or_insert_with() to &'a mut V. This fixes #6394.
2013-06-01 17:37:57 -07:00
bors
63417daea4 auto merge of #6885 : erickt/rust/move-callee_id, r=catamorphism
The `callee_id` in `ast::expr` in only used in a couple expression variants. This moves the `callee_id` into those branches to make it more clear when its should be used.

Also, it fixes a bug in a std::run test when there is a symlink in the path rust where was checked out.
2013-06-01 17:13:39 -07:00
Luqman Aden
ddbd1aa883 Add test for #6861 2013-06-01 18:55:49 -04:00
bors
24e85ac82d auto merge of #6880 : thomaslee/rust/issue-6745, r=catamorphism
This fixes #6745, which itself relates to #4202. Slightly ham-fisted -- feel particularly funny about using the typeck phase to gather the base -> impl mapping, and the separate code paths for traits vs. "real" bases feels like it could be avoided -- but it seems to work.

As always, open to suggestions if there's a better way to accomplish what I'm trying to do.

@catamorphism r?
2013-06-01 15:46:40 -07:00
Erick Tryzelaar
23808efd11 syntax: move callee_id into the expr_ variants 2013-06-01 15:31:56 -07:00
bors
c35b7b5d6e auto merge of #6889 : luqmana/rust/unit-struct-drop, r=catamorphism
Fixes #6861
2013-06-01 14:52:42 -07:00
Luqman Aden
64759c9f25 librustc: Have destructor run for unit-like structs. 2013-06-01 17:41:07 -04:00
Jed Davis
c5d7a77a53 Fix vec::each* return values 2013-06-01 11:52:02 -07:00
Erick Tryzelaar
871684376f std: fix run tests when symlink is in the rust checkout path 2013-06-01 10:59:24 -07:00
Corey Richardson
023861cbd1 test fixes 2013-06-01 13:24:58 -04:00
bors
44af5064d0 auto merge of #6871 : pcwalton/rust/de-pub-impl, r=pcwalton 2013-06-01 09:37:39 -07:00
Patrick Walton
5fb254695b Remove all uses of pub impl. rs=style 2013-06-01 09:18:27 -07:00