Commit Graph

15403 Commits

Author SHA1 Message Date
Marvin Löbel
3edc7c0b9c Removed generic infinity, NaN and negative zero functions
Removed Round impl for integers
2013-02-15 05:46:07 +01:00
Marvin Löbel
df36a8dfc9 Long lines, proper FIXME, inlining 2013-02-15 05:40:01 +01:00
Marvin Löbel
bd93a36d73 Made num <-> str conversion functions use NumStrConv trait
Removed hacky dependency on Round trait and generic infinity functions
Removed generic-runtime-failure-depending-on-type behavior
2013-02-15 05:20:36 +01:00
Marvin Löbel
26e0aafb88 Added NumStrConv trait and impls for the string conversion functions 2013-02-15 04:40:32 +01:00
Marvin Löbel
adac6cb5c6 Moved numeric string conversion functions into own module 2013-02-15 03:29:36 +01:00
bors
bf27352953 auto merge of #4911 : lifthrasiir/rust/comment-exemptions, r=catamorphism
This is a natural extension of #4887, and handles the following three cases:

~~~~
a line with only /s
////////////////////////////////////////////

a line with only /s followed by whitespace
////////////////////////////////////////////         

a block comment with only *s between two /s
/********************************/
~~~~
2013-02-14 16:34:38 -08:00
bors
3c07d037cd auto merge of #4934 : nickdesaulniers/rust/issue4524cleanup, r=brson
review? @brson
Issue #4524
2013-02-14 15:37:48 -08:00
bors
03743ee449 auto merge of #4932 : pcwalton/rust/implflipping, r=pcwalton
...lflipping
2013-02-14 14:46:49 -08:00
Patrick Walton
9143688197 librustc: Replace impl Type : Trait with impl Trait for Type. rs=implflipping 2013-02-14 14:44:12 -08:00
Nick Desaulniers
4699ac67c6 Remove all final references to die! 2013-02-14 13:09:09 -08:00
bors
8ec6f43d6c auto merge of #4931 : thestinger/rust/glue, r=pcwalton
Using `noinline` causes a 3-10% hit in performance for most compiled Rust code. For the TreeMap it's ~15% and that's where I first noticed it.

Removing the noinline attribute doesn't slow down unoptimized builds, but it does significantly increase the time spent in LLVM passes for optimized builds. The improved speed of the compiler actually improves compile-times when optimization is off.

However, the reason for the increase is because more optimization is being done - I'm sure it would speed up compiles to mark *everything* with noinline, but it wouldn't be a good idea.

LLVM is clever enough with the inlining heuristics that this doesn't cause a notable increase in code size - some code becomes a bit bigger, some becomes a bit smaller. There are some cases where it's able to strip out a ton of code thanks to inlining.

I tried out `optsize` for glue code instead but it caused the same hit for LLVM passes in the compile time and the compiled code was a bit slower than just trusting LLVM to make the decisions.

* [TIME_PASSES=1 benchmarks](http://ompldr.org/vaGdxaA) (showing the performance increase in `rustc` and also the extra time spent in LLVM passes for more optimization)
2013-02-14 12:06:27 -08:00
Daniel Micay
762ce323c0 stop applying noinline to glue code 2013-02-14 14:48:34 -05:00
Patrick Walton
e8f36d5ea0 librustc: Replace impl Type : Trait with impl Trait for Type. rs=implflipping 2013-02-14 11:47:00 -08:00
bors
36edd25639 auto merge of #4925 : cpeterso/rust/docs-impl-trait-for-type, r=pcwalton
Replace `impl Type: Trait` with `impl Trait for Type` throughout tutorial and manual.
2013-02-14 10:22:34 -08:00
bors
f06f68d634 auto merge of #4915 : luqmana/rust/rt-cleanup, r=pcwalton
Closes #1190.

Also, got rid of `rust_ptr_eq` since it isn't used any as well the `RUST_REFCOUNTED` macros.

Fixes #2667: alignment & wrong structure.
2013-02-14 09:38:05 -08:00
bors
6366e74fe3 auto merge of #4910 : pcwalton/rust/num-simplification, r=pcwalton
Sadly I could not use trait inheritance due to a type parameter substitution
bug.

r? @brson
2013-02-14 08:59:41 -08:00
Patrick Walton
216e85fadf libcore: Move the numeric operations out of Num. r=brson
Sadly I could not use trait inheritance due to a type parameter substitution
bug.
2013-02-14 08:14:01 -08:00
Chris Peterson
5a4695d407 update tutorial and manual to use new impl Trait for Type syntax 2013-02-13 23:19:27 -08:00
bors
6efa3543a8 auto merge of #4922 : jbclements/rust/add-deriving-eq-to-asts, r=catamorphism
r?

Apply deriving_eq to the data structures in ast.rs, and get rid of the custom definitions of eq that were everywhere. resulting ast.rs is about 400 lines shorter.

Also: add a few test cases and a bunch of comments.

Also: change ast_ty_to_ty_cache to use node ids rather than ast::ty's. I believe this was a suggestion related to my changes, and it appears to pass all tests.

Also: tiny doc fix, remove references to crate keywords.
2013-02-13 18:49:29 -08:00
Kang Seonghoon
5336bf6add made licenseck.py work for year substitutions 2013-02-14 11:20:40 +09:00
bors
0ae74bef18 auto merge of #4905 : brson/rust/issue4524, r=brson
Rebase of #4895
2013-02-13 17:11:08 -08:00
Nick Desaulniers
4445b38df2 Remove die!, raplace invocations with fail! Issue #4524 pt 3 2013-02-13 17:01:32 -08:00
bors
c51ecc3223 auto merge of #4884 : pcwalton/rust/pretty-print-new-impl-syntax, r=pcwalton
r? @brson
2013-02-13 15:49:01 -08:00
John Clements
f9d789fa08 cleanup, fix test case 2013-02-13 15:38:42 -08:00
Patrick Walton
754718c910 libsyntax: Pretty print using the new impl syntax. r=brson 2013-02-13 15:23:48 -08:00
bors
d5bf3b85d1 auto merge of #4908 : bstrie/rust/rimov3, r=pcwalton
This patch finishes removing inner vector mutability from the vast majority of the compiler. Exceptions:

* core::dvec: ideally this entire type will be able to be replaced by `~[]`, but Niko asked me to hold off on removing Dvecs until he makes some fixes to borrowed pointers. 
* liveness: liveness.rs is an impenetrable neutron star of deprecated semantics.
* compile-fail: I'm not sure if a lot of these tests are testing inner mutability or mutability in general. I figure that RIMOVing this folder should wait until this syntax is removed from the parser.

I also took this chance to remove many of the inner-mutability-related functions from core::vec, or as many uses of those functions as possible where still necessary. consume_mut and append_mut have been axed. cast_to_mut and cast_from_mut are still needed in a few places.
2013-02-13 15:09:07 -08:00
John Clements
9d962d8466 add test case 2013-02-13 15:08:27 -08:00
John Clements
ded95d2c28 deriving_eq for tokens and binops
Note that the replaced definition of equality on tokens
contains a *huge* shortcut on INTERPOLATED tokens (those
that contain ASTs), whereby any two INTERPOLATED tokens
are considered equal. This seems like a really broken
notion of equality, but it appears that the existing
test cases and the compiler don't depend on it. Niko
noticed this, BTW.

Replace long definition of Eq on tokens and binops
w
2013-02-13 15:08:27 -08:00
John Clements
16da4e15af use node_id for indexing in ast_to_ty_cache 2013-02-13 15:08:27 -08:00
John Clements
0419e36b76 finish deriving_eq in ast 2013-02-13 15:08:27 -08:00
John Clements
819c6d1c04 deriving-eq all over ast 2013-02-13 15:08:27 -08:00
John Clements
17d3a55362 @mut fix 2013-02-13 15:08:27 -08:00
John Clements
25c4676dfa Commenting, test cases, cleanup 2013-02-13 15:08:27 -08:00
John Clements
6d09fc2cd8 removed reference to crate file keywords 2013-02-13 15:08:26 -08:00
bors
5e6d7871c6 auto merge of #4840 : jbclements/rust/add-json-enum-encoding, r=catamorphism
r?

I added code to the JSON encoder to support the serialization of enums.  Before this, the JSON serializer only handled Option, and encoded None as 'null'. Following this change, all enums are encoded as arrays containing the enum name followed by the encoded fields. This appears consistent with the unstated invariant that the resulting output can be mapped back to the input *if* there's a decoder around that knows the types that were in existence when the serialization occurred.

Also, added test cases.
2013-02-13 13:18:38 -08:00
Luqman Aden
2c198561dd rt: Fix alignment in debug_opaque 2013-02-13 15:41:38 -05:00
Luqman Aden
c22d0af14c rt: take into account alignment for debug_opaque. Closes #2667 2013-02-13 15:41:38 -05:00
Luqman Aden
d67e144f68 rt: get rid of rust_fn and replace with fn_env_pair plus a little cleanup. 2013-02-13 15:41:38 -05:00
bors
7393fde763 auto merge of #4515 : graydon/rust/bench-harness, r=graydon
This is scaffolding for the new #[bench] attribute for marking unit tests as benchmarks. They are run with the --bench flag that the test runner now accepts. The runner automatically calibrates a test loop to an appropriate count to get a good per-iteration measurement.
2013-02-13 12:40:54 -08:00
Graydon Hoare
e5aa399e0d rustc and std: teach about #[bench], modernize to use quote_expr! some. 2013-02-13 11:46:25 -08:00
Graydon Hoare
ebe99637fd std: add stats. 2013-02-13 11:46:25 -08:00
Graydon Hoare
73280b0472 core: add abs to num. 2013-02-13 11:46:25 -08:00
Graydon Hoare
389125aeb8 core: add min and max to cmp, re-export various places. 2013-02-13 11:46:25 -08:00
John Clements
9df11ae83f retabbing 2013-02-13 10:49:36 -08:00
bors
d06e6e758a auto merge of #4892 : pcwalton/rust/xc-newtype-structs, r=pcwalton
r? @brson
2013-02-13 10:22:42 -08:00
Tim Chevalier
e92e3e4578 Add forgotten authors Jesse Jones, Mark Vian, and Trinick 2013-02-13 09:59:57 -08:00
Tim Chevalier
c42a36776f Add Brendan Zabarauskas to AUTHORS 2013-02-13 09:53:10 -08:00
Ben Striegel
e6c82c0375 RIMOV core::vec
Also remove as many uses as possible of vec::cast_to_mut and
cast_from_mut
2013-02-13 12:48:24 -05:00
Ben Striegel
4de76aeb14 RIMOV core::hash 2013-02-13 12:47:44 -05:00
Ben Striegel
808ccd3349 RIMOV core::io 2013-02-13 12:47:44 -05:00