Commit Graph

13760 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
bors
5a9da65dc9 auto merge of #4937 : luqmana/rust/remove-mut-addr-of, r=catamorphism 2013-02-14 19:16:07 -08:00
Luqman Aden
206757f868 libcore: replace mut_addr_of properly on mac 2013-02-14 18:36:10 -08:00
Luqman Aden
cc89029942 libcore: Remove ptr::mut_addr_of since &mut is coerced to *mut 2013-02-14 18:36:10 -08:00
Marvin Löbel
adac6cb5c6 Moved numeric string conversion functions into own module 2013-02-15 03:29:36 +01:00
bors
20fd0c53ed auto merge of #4938 : thestinger/rust/no_zero, r=brson
I removed the unused wrappers methods named `calloc` because they relied on the malloc wrapper having a `bool zero = true` default parameter (which resulted in some accidental zeroing). Perhaps wrapping the actual calloc function would be useful, but I don't know of an existing use case that could use it so I just removed these.

This gives an ~1% performance improvement for TreeMap, which does a lot of small allocations. Vectors use `realloc` which didn't zero before these changes so there's no measurable change in performance.
2013-02-14 18:27:54 -08:00
Tim Chevalier
dcb98f4097 core: Clean up XXXes 2013-02-14 18:17:56 -08:00
Nick Desaulniers
13fe167dbb remove die definition and use in doc tests 2013-02-14 17:33:16 -08:00
bors
af2f0ef088 auto merge of #4927 : sanxiyn/rust/remove-dvec, r=catamorphism 2013-02-14 17:23:18 -08: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
Nick Desaulniers
5d62a4a52e Convert all uses of vec::slice to vec::view Issue #3869
Rename const_view to const_slice
Renamed mut_view to mut_slice
2013-02-14 16:14:32 -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
Daniel Micay
1a41b484bf rm the unused calloc wrapper from memory_region
it doesn't actually call calloc, so it's fairly pointless
2013-02-14 18:28:04 -05:00
Daniel Micay
2e0614750c get rid of unused exchange_alloc calloc method
this isn't actually calloc - it calls the malloc wrapper which no
longer zeroes
2013-02-14 18:24:52 -05:00
Daniel Micay
f2f4edd8a7 fix bug in uv_ll tests uncovered by not zeroing 2013-02-14 17:47:15 -05: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
Daniel Micay
7103ca95ac rm unused zero param in C++ exchange allocator 2013-02-14 16:04:30 -05:00
Daniel Micay
22e88d510f stop zeroing all exchange allocations 2013-02-14 15:59:15 -05:00
Daniel Micay
762ce323c0 stop applying noinline to glue code 2013-02-14 14:48:34 -05: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
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
Seo Sanghyeon
26697c371d Remove DVec from workcache 2013-02-14 23:12:12 +09:00
Seo Sanghyeon
9324f497b2 Remove DVec from json 2013-02-14 22:51:01 +09:00
Seo Sanghyeon
ae38935ff3 Remove DVec from check_const 2013-02-14 22:36:56 +09:00
Seo Sanghyeon
7a6db3f982 Remove DVec from syntax::parse 2013-02-14 22:14:59 +09: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
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
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
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
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
Ben Striegel
3a3f7b8e55 RIMOV core::rand 2013-02-13 12:47:44 -05:00
Ben Striegel
2d2ed075e3 RIMOV core::run 2013-02-13 12:47:43 -05:00
Ben Striegel
e58c812f77 Partially de-vec-mut librustc 2013-02-13 12:47:43 -05:00
Patrick Walton
e07623d70b librustc: Make monomorphic newtype structs work cross-crate 2013-02-13 09:47:20 -08:00
bors
6016214101 auto merge of #4900 : luqmana/rust/core_os_errors, r=graydon
Rewrote the last pull request (#4859) to not require on llvm for core.

Also fixes #2269.
2013-02-12 21:27:22 -08:00
bors
27b3e01377 auto merge of #4914 : nikomatsakis/rust/issue-4856, r=nikomatsakis
and then adjust code to match. rs=unsound (will review post-landing)

rs=unsound
2013-02-12 20:40:19 -08:00
Niko Matsakis
ab2534974c Adjust borrow checker algorithm to address #4856 unsoundness,
and then adjust code to match. rs=unsound (will review post-landing)
2013-02-12 20:10:50 -08:00
Kang Seonghoon
6d98ca94cc libsyntax: don't parse ////, /***/ as doc comments 2013-02-13 11:39:13 +09:00
bors
1a394e57f7 auto merge of #4896 : pcwalton/rust/move-speedup, r=pcwalton
r? @nikomatsakis 

When you made the change to fix kinds in recursion, you stopped looking in the master cache. This patch fixes it.
2013-02-12 17:32:29 -08:00
John Clements
46d2be1bd4 added rather elaborate test framework 2013-02-12 17:18:29 -08:00
bors
6727c6fb56 auto merge of #4881 : bjz/rust/incoming, r=catamorphism 2013-02-12 16:22:58 -08:00
Patrick Walton
a165f88272 librustc: Speed up moves a lot. r=nmatsakis 2013-02-12 16:16:23 -08:00
bors
91c59f5c9a auto merge of #4880 : erickt/rust/hashmap-cleanup, r=catamorphism 2013-02-12 15:24:42 -08:00
bors
bc2d147847 auto merge of #4858 : z0w0/rust/rm_weak_task_count, r=graydon 2013-02-12 14:36:33 -08:00
bors
21a0d52a85 auto merge of #4876 : brson/rust/debuginfo, r=brson
Update of #4862
2013-02-12 13:30:07 -08:00
bors
210fa2d017 auto merge of #4874 : thestinger/rust/option, r=catamorphism 2013-02-12 10:35:12 -08:00
bors
1c487b18f3 auto merge of #4867 : z0w0/rust/pruneprelude, r=catamorphism 2013-02-12 09:37:41 -08:00
Graydon Hoare
1d82d8dd5d Revert "librustc: Make monomorphic newtype structs work cross-crate"
This reverts commit a8f039a085.
2013-02-12 09:02:17 -08:00
Luqman Aden
2180fe2552 rt: remove last_os_error from rustrt.def.in 2013-02-12 00:22:58 -05:00
Luqman Aden
44b80ed0d6 Long lines. 2013-02-11 23:49:49 -05:00
Luqman Aden
70185fdcc2 rt: remove last_os_error and adjust tests. 2013-02-11 23:49:49 -05:00
Luqman Aden
625fac3c7e core: Rewrite last_os_error in Rust for windows as well. 2013-02-11 23:49:49 -05:00
Luqman Aden
9877d98b8f core: Rewrite last_os_error in Rust for unix and provide access to errno (unix) and GetLastError (windows). 2013-02-11 23:49:49 -05:00
Patrick Walton
a8f039a085 librustc: Make monomorphic newtype structs work cross-crate 2013-02-11 20:09:11 -08:00
Brian Anderson
9701517703 std: Fix uv_tcp_t size on i686-apple-darwin 2013-02-11 19:24:35 -08:00
Zack Corr
0db527e2f8 core: Fix dec/inc_kernel_live_count mixup 2013-02-12 12:27:19 +10:00
Brian Anderson
b126c742e5 Merge remote-tracking branch 'thestinger/treemap' 2013-02-11 16:13:50 -08:00
Brian Anderson
8ed1c15845 Fix license block 2013-02-11 15:01:24 -08:00
Brian Anderson
744e5adbe3 Merge remote-tracking branch 'cyndis/expansion-span' 2013-02-11 15:01:23 -08:00
Brian Anderson
faef933e75 Merge pull request #4873 from jld/rust-mode-wants-cl-when
rust-mode.el uses the 'cl macros, so it should actually require them
2013-02-11 13:06:57 -08:00
Mikko Perttunen
ca030b4fc8 Update copyright years 2013-02-11 21:02:36 +02:00
Mikko Perttunen
d48bc263b5 Add test for using line! in a macro 2013-02-11 20:26:40 +02:00
Mikko Perttunen
f2a8a71266 Use topmost span for macro expansion location. Fixes behaviour of file!, line! and col! 2013-02-11 20:23:40 +02:00
Daniel Micay
f9c7ba009b treemap: cut down on swap_unwrap in remove
Performance before:

    std::treemap::TreeMap
                   sequential_ints 0.083971 s
                       random_ints 0.095861 s
                       delete_ints 0.083931 s
                sequential_strings 0.278272 s
                    random_strings 0.240286 s
                    delete_strings 0.173581 s

Performance after:

    std::treemap::TreeMap
                   sequential_ints 0.083297 s
                       random_ints 0.097644 s
                       delete_ints 0.052602 s
                sequential_strings 0.287326 s
                    random_strings 0.242372 s
                    delete_strings 0.142269 s
2013-02-10 22:03:26 -05:00
Daniel Micay
b0f58f6e68 avoid explicit reborrow in heir_swap 2013-02-10 21:11:33 -05:00
Zack Corr
33ae05871c core: Fix files that needed GenericChan/Port from prelude 2013-02-11 12:11:23 +10:00
Daniel Micay
195a969bb3 treemap: avoid swap_unwrap in insert
Performance before:

    std::treemap::TreeMap
                   sequential_ints 0.151877 s
                       random_ints 0.160926 s
                       delete_ints 0.08694 s
                sequential_strings 0.316458 s
                    random_strings 0.290778 s
                    delete_strings 0.169892 s

Performance after:

    std::treemap::TreeMap
                   sequential_ints 0.083971 s
                       random_ints 0.095861 s
                       delete_ints 0.083931 s
                sequential_strings 0.278272 s
                    random_strings 0.240286 s
                    delete_strings 0.173581 s
2013-02-10 20:49:44 -05:00
Daniel Micay
f9c15de1fd treemap: use an &mut parameter for skew and split
results in a small performance improvement and reduces the compiled
code size
2013-02-10 20:47:22 -05:00
Brendan Zabarauskas
48b2141b83 Add NumCast trait for generic numeric type casts 2013-02-11 12:33:05 +11:00
Erick Tryzelaar
4fb4a4b66d core: add LinearMap::find_or_insert{,_with}
This allows for inserting a new value into the map only if it doesn't
already exist in the map.
2013-02-10 15:51:25 -08:00
Erick Tryzelaar
849644b5bc core: rename hashmap test functions 2013-02-10 15:51:25 -08:00
Erick Tryzelaar
fed5df8f2e libcore: LinearMap doesn't need to pass around the bucket vec 2013-02-10 15:51:25 -08:00
Jeff Olson
4696fb367c std: fix libuv structs on macos 2013-02-10 14:30:07 -08:00
Daniel Micay
99ff74c1bd make Option's iter method use a lifetime 2013-02-10 16:30:17 -05:00
Jeff Olson
1cbbb58d87 build: change libuv to point at joyent's repo and make unpatched build libuv work on mingw 2013-02-10 11:51:05 -08:00