Commit Graph

19470 Commits

Author SHA1 Message Date
bors
cb58b19f02 auto merge of #7319 : thestinger/rust/hashmap-iterator, r=thestinger
#7277
2013-06-23 11:13:54 -07:00
Ben Blum
394f455b5e Fix error messages in test cases, since fns/traits now pretty-print with a bounds list 2013-06-23 13:53:39 -04:00
Ben Blum
fcf361745f Add rules for assert, fail, and deriving to vim syntax file. Also highlight the mod path in "use module;" properly. 2013-06-23 13:53:39 -04:00
Philipp Brüschweiler
ce888a5055 Fix reflect-visit-type for iterator changes 2013-06-23 17:15:37 +02:00
bors
c17ff80e01 auto merge of #7267 : luqmana/rust/issue-5792, r=cmr
Fixes #5792
2013-06-23 07:52:55 -07:00
bors
2b581c17b5 auto merge of #7258 : huonw/rust/7256, r=bstrie 2013-06-23 05:34:56 -07:00
Philipp Brüschweiler
e2f1049bd5 Remove unused TyDesc parameter from the glue functions
To remove the environment pointer, support for function pointers without
an environment argument is needed (i.e. a fixed version of #6661).
2013-06-23 13:02:00 +02:00
Philipp Brüschweiler
1b76bac41d syntax: Remove unused tokens
TyDesc, TyVisitor and intrinsic are not used anymore.
2013-06-23 12:49:16 +02:00
Philipp Brüschweiler
976c0b3dfb Remove rust_call_tydesc_glue
Towards #4812. Also includes some minor cleanups.
2013-06-23 12:49:16 +02:00
Philipp Brüschweiler
273f90566c Small cleanups 2013-06-23 12:49:16 +02:00
Philipp Brüschweiler
8bf0033345 Remove unused shape fields from typedescs 2013-06-23 12:49:16 +02:00
Philipp Brüschweiler
179ce398ea Fix and reenable the reflect-visit-type test 2013-06-23 12:49:16 +02:00
Philipp Brüschweiler
469f394b25 Remove intrinsic module
To achieve this, the following changes were made:
* Move TyDesc, TyVisitor and Opaque to std::unstable::intrinsics
* Convert TyDesc, TyVisitor and Opaque to lang items instead of specially
  handling the intrinsics module
* Removed TypeDesc, FreeGlue and get_type_desc() from sys

Fixes #3475.
2013-06-23 12:49:16 +02:00
Philipp Brüschweiler
f2c5642d13 Fix get_tydesc() return type
This fixes part of #3730, but not all.
Also changes the TyDesc struct to be equivalent with the generated
code, with the hope that the above issue may one day be closed for good,
i.e. that the TyDesc type can completely be specified in the Rust
sources and not be generated.
2013-06-23 12:46:28 +02:00
Daniel Micay
ac2e167e7e hashmap: add FIXME number 2013-06-23 05:13:13 -04:00
blake2-ppc
8baefec013 std::to_str: Use .iter() for HashMap and HashSet 2013-06-23 04:23:12 -04:00
blake2-ppc
13f666a724 std::hashmap: Remove BaseIter impl for HashSet
Remove the BaseIter impl, while keeping the .each method until callers
are converted.
2013-06-23 04:23:01 -04:00
blake2-ppc
f045210857 std::hashmap: Use .iter() instead of .each and similar 2013-06-23 04:23:00 -04:00
blake2-ppc
3af1d20bea std::hashmap: Add test_iterate for HashSet 2013-06-23 04:23:00 -04:00
blake2-ppc
080d498af2 std::hashmap: Implement external iterator for HashMap and HashSet 2013-06-23 04:23:00 -04:00
bors
3b126e4d6d auto merge of #7274 : thestinger/rust/size_hint, r=huonw
I ran into a weird lifetime bug blocking updating the `collect` method to use `FromIterator`, but everything here works fine.
2013-06-22 23:07:55 -07:00
Daniel Micay
d2e9912aea vec: remove BaseIter implementation
I removed the `static-method-test.rs` test because it was heavily based
on `BaseIter` and there are plenty of other more complex uses of static
methods anyway.
2013-06-23 02:05:20 -04:00
Steven Stewart-Gallus
0f55c9cc7e Cleaned up middle a bit.
The only really tricky change is that a long chain of ifs, and elses
was turned into a single if, and a match in astencode.rs. Some methods
can only be called in certain cases, and so have to come after the if.
2013-06-22 18:58:41 -07:00
bors
fc83d82fec auto merge of #7204 : alexcrichton/rust/deriving-to-string, r=pcwalton
Closes #7180 and #7179.

Before, the `deriving(ToStr)` attribute was essentially `fmt!("%?")`. This changes it to recursively invoke `to_str()` on fields instead of relying on `fmt!`-style things. This seems more natural to me and what should actually be expected.
2013-06-22 17:13:51 -07:00
bors
0739c6b5a0 auto merge of #7214 : Blei/rust/fix-owned-traits, r=pcwalton
This finishes the incomplete conversion of unique traits as two-word
allocations started in 211d038abc.

Fixes #5882, #6717, #7153, #7208.
2013-06-22 13:29:10 -07:00
Daniel Micay
c9342663df iterator: add a FromIterator trait
This is able to take advantage of the lower bound from the size hint.
2013-06-22 15:59:59 -04:00
Daniel Micay
468cbd9d01 iterator: add a size_hint default method
also adds an implementation for the vector iterators
2013-06-22 15:59:59 -04:00
Daniel Micay
df166bae1f Merge pull request #7227 from alexcrichton/issue-7218
Fix compiling empty fmt! strings
2013-06-22 12:59:37 -07:00
Daniel Micay
ef07d7c46e Merge pull request #7270 from thestinger/doc
accumulated doc pull requests from the queue
2013-06-22 12:56:37 -07:00
Daniel Micay
69e0704520 Merge pull request #7230 from Blei/green-squiggle
syntax::diagnostics: Color the ^~~~ in green for better visibility
2013-06-22 12:50:47 -07:00
Alex Crichton
df626ea137 Fix compiling empty fmt! strings 2013-06-22 11:19:35 -07:00
Alex Crichton
30d755957a Expand the deriving(ToStr) implementation 2013-06-22 09:53:17 -07:00
reus
9b2d9a9539 replaced some 'std::' with 'extra::' in comments 2013-06-22 17:49:32 +08:00
Philipp Brüschweiler
de471a2eca Fix take glue of owned trait objects
This finishes the incomplete conversion of unique traits as two-word
allocations started in 211d038abc.

Fixes #5882, #6717, #7153, #7208.
2013-06-22 09:37:40 +02:00
Brian Anderson
dfc04e5edb rustc: Fix formatting of --help 2013-06-22 00:57:12 -04:00
bors
dc4560dc26 auto merge of #7182 : Aatch/rust/trans-refactor-pt2, r=graydon
This is another big refactoring of `trans` though this is unlikely to have much of an
impact on code size or speed.

The major change here is the implementation of a `Type` struct which is the new
home for all your LLVM `TypeRef` needs. It's a simple wrapper struct, with static
methods for constructing types, then regular methods for
manipulating/interrogating them. The purpose of this is mostly to make the code
surrounding them somewhat more ideomatic. A line like: `T_ptr(T_ptr(T_i8()))` is 
now `Type::i8().ptr_to().ptr_to()`,which is much more like regular Rust code.

There are a variety of smaller changes here and there:

* Remove address spaces. At least it doesn't generate them, I haven't spent much
  time looking for related code.
* Use a macro for declaring the LLVM intrinsics, makes it look much nicer.
* Make the type for a string slice actually create a named `str_slice` type in LLVM,
  this makes reading the appropriate code much easier.
* Change the way struct and enum type names are generated. This just means
  that a struct like `struct Foo { a: int }` now produces the IR 
  `%struct.Foo = type { i64 }`, which is much easier to read. Similarly, other structs
  are a bit tighter to make it easier to read.

--- --- ---

This PR did get away from me a little, as I occasionally got distracted or as I fixed
up problems with unrelated code that were stopping me from continuing. One major
thing is that this PR contains the work from #7168, since that would have conflicted
with this and it was broken anyway. Sorry for bundling it like this.

Fixes #3670 and #7063

--- --- ---

EDIT: This no longer removes the llvm insn stats.
2013-06-21 19:19:58 -07:00
James Miller
e3ef7504e9 Fix merge fallout 2013-06-22 13:41:52 +12:00
James Miller
fb6dc957d6 Remove remaining address space related code 2013-06-22 12:38:40 +12:00
James Miller
761fc16c60 Fix-up PP Code to reflect new lifetime param syntax 2013-06-22 12:38:40 +12:00
James Miller
048ed1486f Move count-llvm-insn code into task-local storage 2013-06-22 12:38:40 +12:00
James Miller
0b0c756c9c Fix warnings in trans 2013-06-22 12:38:40 +12:00
James Miller
81cf72c264 Finish up Type refactoring 2013-06-22 12:35:35 +12:00
James Miller
57a75374d6 Initial Type Refactoring done 2013-06-22 12:32:11 +12:00
James Miller
befbd3a680 Add the rest of the atomic operations.
This makes the handling of atomic operations more generic, which
does impose a specific naming convention for the intrinsics, but
that seems ok with me, rather than having an individual case for
each name.

It also adds the intrinsics to the the intrinsics file.
2013-06-22 12:26:33 +12:00
James Miller
fd83b92b59 More Type refactorings 2013-06-22 12:26:33 +12:00
James Miller
1968622798 Start refacting LLVM Type handling 2013-06-22 12:24:21 +12:00
James Miller
66d8e8b481 Make log_fn_time a method 2013-06-22 12:24:21 +12:00
James Miller
b4b2cbb299 Change calls for TypeName stuff to methods 2013-06-22 12:24:20 +12:00
James Miller
3dbdb3a364 Methodize TypeNames 2013-06-22 12:24:20 +12:00
bors
f886520d24 auto merge of #7219 : sstewartgallus/rust/cleanup, r=graydon 2013-06-21 16:01:59 -07:00