Commit Graph

19440 Commits

Author SHA1 Message Date
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
Corey Richardson
116897fa6c Remove ast::pure_fn and all concept of pure from the compiler 2013-06-21 18:10:56 -04:00
Honza Strnad
f3966e4a08 Added filtered method for Option type 2013-06-21 21:27:58 +02:00
bors
544f6159f7 auto merge of #7259 : dotdash/rust/ir_improvement, r=graydon
The changes in these commits improve the IR codegen by removing unnecessary copies for certain function call arguments and stopping to allocate return values for functions returning nil. They reduce compile times by about 10% in total.
2013-06-21 07:52:55 -07:00
Björn Steinbrink
4fb2c09541 Avoid pointless allocas for "nil" return values
By using "void" instead of "{}" as the LLVM type for nil, we can avoid
the alloca/store/load sequence for the return value, resulting in less
and simpler IR code.

This reduces compile times by about 10%.
2013-06-21 13:36:25 +02:00
bors
45f588e8fd auto merge of #7200 : yichoi/rust/fix_je_mac_cross, r=brson
while cross-compiling, ar in cross toolchains are required. 
linux is not sensitive so could not see errors.
2013-06-21 04:10:53 -07:00
bors
b0e3ffd380 auto merge of #7263 : thestinger/rust/iterator, r=graydon 2013-06-21 01:49:50 -07:00
Daniel Micay
06bec77faf replace vec::find with the IteratorUtil method 2013-06-21 03:24:03 -04:00
Daniel Micay
883c966d5c vec: replace position with iter().position_ 2013-06-21 03:23:59 -04:00
Daniel Micay
49c74524e2 vec: rm old_iter implementations, except BaseIter
The removed test for issue #2611 is well covered by the `std::iterator`
module itself.

This adds the `count` method to `IteratorUtil` to replace `EqIter`.
2013-06-21 03:20:22 -04:00
Daniel Micay
cbad1da3db vec: remove eachi
replaced by the `enumerate` method from std::iterator
2013-06-21 03:20:22 -04:00
Daniel Micay
62dc4e0d4c vec: remove each_const
An Iterator implementation can be made for &const [T] if it turns out
to be necessary for some use case.
2013-06-21 03:20:22 -04:00
bors
ba05af7b1c auto merge of #7203 : msullivan/rust/default-methods, r=graydon
This fixes the large number of problems that prevented cross crate
methods from ever working. It also fixes a couple lingering bugs with
polymorphic default methods and cleans up some of the code paths.

Closes #4102. Closes #4103.

r? nikomatsakis
2013-06-20 22:28:52 -07:00
Ralph Bodenner
fd24cb7eae Usable instructions for generating docs from source 2013-06-21 00:56:43 -04:00
Huon Wilson
769c2e5f99 Minor doc updates to reflect #[deriving(Zero)], and small release notes adjustments.
The `extra::fileinput` module landed just after 0.6 was released, and there are many
more derivable traits.
2013-06-21 00:55:13 -04:00
Brian Anderson
9e95bc4b19 Update AUTHORS.txt 2013-06-21 00:54:17 -04:00
Joris Rehm
87c110506d fix text of tutorials 2013-06-21 00:53:10 -04:00
Ralph Bodenner
525933d0a3 Show defaults in rustdoc usage message 2013-06-21 00:51:28 -04:00
Brian Anderson
7d61b0083a More 0.7 release notes 2013-06-21 00:49:15 -04:00
bors
77ae7ec8d8 auto merge of #7161 : kballard/rust/terminfo-parm-format, r=thestinger
Introduce support for terminfo's subset of printf-style formatting on doxXs operations.

r? @thestinger
2013-06-20 20:41:09 -07:00
Luqman Aden
41e90f2156 Add test for duplicate definitions of structs and enum struct variants. 2013-06-20 19:23:31 -04:00
Luqman Aden
31b4b53797 librustc: Don't allow enum struct variants to shadow structs. 2013-06-20 19:14:57 -04:00
Kevin Ballard
b8b2d1e5b4 Make task_rng() return @mut R instead of @@mut R 2013-06-20 15:55:43 -07:00
Michael Sullivan
1a8969f64b Get cross crate default methods working.
This fixes the large number of problems that prevented cross crate
methods from ever working. It also fixes a couple lingering bugs with
polymorphic default methods and cleans up some of the code paths.

Closes #4102. Closes #4103.
2013-06-20 15:42:16 -07:00
Björn Steinbrink
dc262d9aa7 Avoid unnecessary scratch datums for by-copy function arguments
Currently, by-copy function arguments are always stored into a scratch
datum, which serves two purposes.  First, it is required to be able to
have a temporary cleanup, in case that the call fails before the callee
actually takes ownership of the value. Second, if the argument is to be
passed by reference, the copy is required, so that the function doesn't
get a reference to the original value.

But in case that the datum does not need a drop glue call and it is
passed by value, there's no need to perform the extra copy.
2013-06-20 23:53:26 +02:00
bors
f348465283 auto merge of #7128 : yichoi/rust/fix_sometc, r=brson
- Fix stat struct for Android (found by SEGV at run-pass/stat.rs)
- Adjust some test cases to rpass for Android 
- Modify some script to rpass for Android
2013-06-20 11:35:34 -07:00