Commit Graph

1795 Commits

Author SHA1 Message Date
Brendan Zabarauskas
b9824e18c2 Add Scheme-style cond! macro to syntax::ext::expand
Addresses issue #6037
2013-05-15 07:02:43 +10:00
Brian Anderson
133aabc5bb Ignore two failing flatpipes tests 2013-05-14 11:35:10 -07:00
Alex Crichton
ccfb3ebf03 rusti: Remove #[allow(vecs_implicitly_copyable)] 2013-05-14 12:25:18 -04:00
Marvin Löbel
04de8f852c Fix cosmetics for fail!() calls 2013-05-14 16:36:24 +02:00
Björn Steinbrink
bdc182cc41 Use static string with fail!() and remove fail!(fmt!())
fail!() used to require owned strings but can handle static strings
now. Also, it can pass its arguments to fmt!() on its own, no need for
the caller to call fmt!() itself.
2013-05-14 16:36:23 +02:00
gifnksm
da9c1fbf27 libstd: Add tests for BigRational 2013-05-14 21:59:13 +09:00
gifnksm
76ecce0e0c libstd: Ratio requires Clone instead of Copy
This allows creating `Ratio<T>` which `T` is non-implicitly copyable types
such as `BigInt`.
2013-05-14 21:59:08 +09:00
gifnksm
41eaa97372 libstd: Rational requires Integer as type bounds instead of Num 2013-05-14 21:55:42 +09:00
gifnksm
e3695468b7 libstd: impl Orderable for BigUint/BigInt 2013-05-14 21:20:27 +09:00
gifnksm
5ce0795de5 libstd: impl Num for BigUint/BigInt 2013-05-14 19:27:20 +09:00
Daniel Micay
e1a1992276 revert PriorityQueue to using init()
uninit() would result in potentially running a destructor on arbitrary
memory if the Ord implementation throws
2013-05-13 19:46:20 -04:00
bors
ad5bfd600d auto merge of #6387 : brson/rust/unstable, r=brson
r? @pcwalton

* Move `SharedMutableState`, `LittleLock`, and `Exclusive` from `core::unstable` to `core::unstable::sync`
* Modernize the `SharedMutableState` interface with methods
* Rename `SharedMutableState` to `UnsafeAtomicRcBox` to match `RcBox`.
2013-05-13 14:49:48 -07:00
Brian Anderson
369231beb4 core: Rename SharedMutableState to UnsafeAtomicRcBox 2013-05-13 12:13:56 -07:00
Brian Anderson
fa1d0477ed core: Move locks, atomic rc to unstable::sync 2013-05-13 12:13:56 -07:00
Patrick Walton
58a37a1f48 libstd: Fix merge fallout. 2013-05-12 17:36:53 -07:00
Patrick Walton
06ef889cdc libsyntax: Remove extern mod foo { ... } from the language. 2013-05-12 16:33:15 -07:00
bors
36771ef609 auto merge of #6429 : gifnksm/rust/bigint-is_even, r=catamorphism
`BigUint::is_even()` didn't return correct value.
2013-05-11 22:40:36 -07:00
Corey Richardson
a279d65102 clean up the last bit of warnings 2013-05-11 20:36:47 -07:00
Tim Chevalier
ed41864464 Warning police 2013-05-11 20:36:44 -07:00
gifnksm
a2b81ccba4 libstd: Fix BigUint::is_even 2013-05-12 10:17:23 +09:00
bors
957251817b auto merge of #6389 : sonwow/rust/issue-3356, r=bstrie
Fix for #3356
2013-05-11 12:55:49 -07:00
bors
9f106a643e auto merge of #6260 : alexcrichton/rust/issue-3466-no-swap, r=pcwalton
There may be a more efficient implementation of `core::util::swap_ptr`. The issue mentioned using `move_val_init`, but I couldn't figure out what that did, so I just used `copy_memory` a few times instead.

I'm not exactly the best at reading LLVM generated by rust, but this does appear to be optimized away just as expected (when possible).
2013-05-10 20:35:00 -07:00
Alex Crichton
998fececd6 Stop using the '<->' operator 2013-05-10 22:51:06 -04:00
bors
c49cf8b330 auto merge of #6205 : brson/rust/flate, r=brson
r? @graydon

I don't think this is necessary in core.
2013-05-10 19:41:00 -07:00
bors
3e0400fb86 auto merge of #6223 : alexcrichton/rust/issue-6183, r=pcwalton
Closes #6183.

The first commit changes the compiler's method of treating a `for` loop, and all the remaining commits are just dealing with the fallout.

The biggest fallout was the `IterBytes` trait, although it's really a whole lot nicer now because all of the `iter_bytes_XX` methods are just and-ed together. Sadly there was a huge amount of stuff that's `cfg(stage0)` gated, but whoever lands the next snapshot is going to have a lot of fun deleting all this code!
2013-05-10 17:56:02 -07:00
Alex Crichton
b05aae2d41 test: Use the new for protocol 2013-05-10 19:20:20 -04:00
Brian Anderson
7652f3ddb8 Move flate from core to std 2013-05-10 16:00:26 -07:00
Youngsoo Son
24ef88cee9 renamed str::from_slice to str::to_owned 2013-05-10 20:08:56 +09:00
bors
fdf601eaf3 auto merge of #6358 : crabtw/rust/mips-segstk, r=brson
I changed ```RED_ZONE_SIZE``` to ```RZ_MAC_32``` because of stack canary failure.
Here is a LLVM patch for MIPS segmented stacks.
http://people.cs.nctu.edu.tw/~jyyou/rust/mips-segstk.patch

Current test results
```
failures:
    rand::tests::test_rng_seeded_custom_seed2
    run::tests::test_forced_destroy_actually_kills
    run::tests::test_unforced_destroy_actually_kills
    time::tests::run_tests
    uv_ll::test::test_uv_ll_struct_size_addrinfo
    uv_ll::test::test_uv_ll_struct_size_uv_timer_t

segfaults:
    rt::io::option::test::test_option_writer_error
    rt::local_services::test::unwind
    rt::sched::test_swap_tasks_then
    stackwalk::test_simple
    stackwalk::test_simple_deep
```
2013-05-10 04:07:50 -07:00
bors
6da2c989ba auto merge of #6329 : sonwow/rust/issue-6306, r=ILyoan
Fix for #6306
2013-05-10 03:04:51 -07:00
Youngsoo Son
b7da975049 renamed vec::from_slice to vec::to_owned 2013-05-10 18:38:54 +09:00
bors
3e106cf2c2 auto merge of #6339 : alexcrichton/rust/unsafe-cvec, r=catamorphism
As noted by @jwise [here](52445129fd (commitcomment-3172192)), it's probably a good idea to keep these unsafe.

The lint check won't warn about these because it ignore `unsafe fn` declarations.
2013-05-09 23:58:53 -07:00
Alex Crichton
a87db3e2cd rustc: Use the new for protocol 2013-05-10 02:46:19 -04:00
Alex Crichton
3ce9dba677 std: Use the new for protocol 2013-05-10 02:46:18 -04:00
Youngsoo Son
c8e93edf55 Move core::task::local_data to core::local_data 2013-05-10 11:42:45 +09:00
bors
7675856253 auto merge of #6354 : Aatch/rust/uninit-intrinsic, r=graydon
Adds an `uninit` intrinsic.

It's just an empty function, so llvm optimizes it down to nothing.

I changed all of the `init` intrinsic usages to `uninit` where it seemed appropriate to.
2013-05-09 12:37:00 -07:00
bors
ce9c0225c4 auto merge of #6349 : thestinger/rust/explicit_copy, r=thestinger
I removed some of the copies, but most are just made explicit. The usage in `libcore` was already fixed, but the attribute was only set to warn (not removed).
2013-05-09 11:18:43 -07:00
Daniel Micay
2bc12635a2 remove vecs_implicitly_copyable from libstd/libcore 2013-05-09 14:00:53 -04:00
Alex Crichton
d6efbad33f Mark c_vec functions as unsafe again 2013-05-09 07:40:19 -04:00
James Miller
414970c46f Add intrinsic declaration where I missed them 2013-05-09 23:16:07 +12:00
James Miller
57509709b4 Make staged versions of the functions that use uninit 2013-05-09 23:05:17 +12:00
bors
ca95e7f94e auto merge of #6345 : seanmoon/rust/fix-typos, r=sanxiyn
Hi there,

Really enjoying Rust. Noticed a few typos so I searched around for a few more--here's some fixes.

Ran `make check` and got `summary of 24 test runs: 4868 passed; 0 failed; 330 ignored`.

Thanks!

Sean
2013-05-09 03:51:32 -07:00
James Miller
f5ab112e6b Replace init() with uninit() where appropriate 2013-05-09 22:41:54 +12:00
Jyun-Yan You
c2bf9bf9fe improve MIPS backend and implement segmented stacks 2013-05-09 16:51:42 +08:00
bors
fda176b070 auto merge of #6337 : thestinger/rust/fix_region, r=thestinger
also removes unnecessary casts from the RcMut implementation
2013-05-09 00:15:33 -07:00
bors
936c07dcf0 auto merge of #6328 : recrack/rust/rename_cleanup, r=sanxiyn
rename vec::each(var) to var.each

> librustc, libsyntax, libstd, librustdoc, libcore
2013-05-08 22:54:37 -07:00
Youngmin Yoo
d4fa0f1485 libstd: rename vec::each(var) to var.each 2013-05-09 14:20:04 +09:00
bors
101d4bf8b2 auto merge of #6332 : huonw/rust/std-base64-match, r=nikomatsakis 2013-05-08 21:45:37 -07:00
Patrick Walton
16a0125e41 libcore: Fix tests. 2013-05-08 17:04:01 -07:00
Patrick Walton
49a66a5c5a librustc: Stop parsing modes and remove them entirely from the language 2013-05-08 17:04:01 -07:00
Patrick Walton
99daec602f librustc: Fix merge fallout. 2013-05-08 17:04:00 -07:00
Patrick Walton
c7522417d4 libstd: Remove some residual mutable fields 2013-05-08 17:04:00 -07:00
Patrick Walton
d12d25534b libcore: Remove more mutable fields from comm 2013-05-08 17:03:59 -07:00
Patrick Walton
6a44482b17 libcore: Remove mutable fields from pipes 2013-05-08 17:03:59 -07:00
Patrick Walton
803a4f45fa libcore: Remove mutable fields from the task builder API 2013-05-08 17:03:59 -07:00
Patrick Walton
b2d1ac100f libcore: Remove mutable fields from rand. 2013-05-08 17:03:58 -07:00
Patrick Walton
ee78d811e4 libstd: Start warning about mutable fields, now that they only exist in stage0 2013-05-08 17:03:58 -07:00
Patrick Walton
bba0680cb0 libstd: Remove mutable fields from future and par 2013-05-08 17:03:58 -07:00
Patrick Walton
92d2ec4d32 libstd: Remove mutable fields from flatpipes and io_util 2013-05-08 17:03:58 -07:00
Patrick Walton
da2ac90812 libstd: Remove mutable fields from fileinput and net_tcp 2013-05-08 17:03:57 -07:00
Daniel Micay
044abef0e5 fix incorrect region code based on the old 'self
also removes unnecessary casts from the RcMut implementation
2013-05-08 16:00:49 -04:00
Sean Moon
bd4ee7c7d2 Fix typos 2013-05-09 02:34:47 +09:00
Huon Wilson
ad5ee00c93 libstd: convert chained ifs to a match in base64. 2013-05-08 23:50:15 +10:00
bors
b6f9295654 auto merge of #6317 : brson/rust/durable, r=z0w0
#6312
2013-05-08 05:03:38 -07:00
bors
625e518ffe auto merge of #6305 : thestinger/rust/rc, r=nikomatsakis 2013-05-08 00:21:38 -07:00
bors
847552f48b auto merge of #6301 : bjz/rust/numeric-traits, r=pcwalton
This is part of the redesign of the numeric traits tracked in issue #4819.

Renamed:

- `Exponential::expm1` -> `Float::exp_m1` - for consistency with underscore usage elsewhere
- `Exponential::log` -> `Exponential::ln` - a less ambiguous name for the natural logarithm
- `{float, f64, f32}::logarithm` -> `Exponential::log` - for arbitrary base logarithms
- `Real::log_2` -> `Real::ln_2`  - for consistency with `ln`
- `Real::log_10` -> `Real::ln_10` - for consistency with `ln`

Added:

- `Signed::abs_sub` - wraps libm's `fdim` function
- `Float::is_normal` - returns `true` if the number is neither zero, infinite, subnormal or NaN
- `Float::classify` - returns the floating point category of the number
- `Float::ln_1p` - returns the natural logarithm of the number plus one
2013-05-07 16:18:37 -07:00
Brian Anderson
ccc4c1a5e0 std: Replace Durable with 'static 2013-05-07 15:30:40 -07:00
Daniel Micay
96eb1e50a4 arc: mark RWARC as non-Const 2013-05-07 13:03:40 -04:00
Daniel Micay
43165b54e0 rc: remove the managed pointer workaround 2013-05-07 13:02:56 -04:00
bors
38a6a7a394 auto merge of #6276 : brson/rust/issue-6122, r=graydon 2013-05-07 06:06:42 -07:00
Brendan Zabarauskas
a9ac2b95f4 Add abs_sub method to Signed trait 2013-05-07 19:16:03 +10:00
bors
3225870191 auto merge of #6236 : alexcrichton/rust/more-map-methods, r=thestinger
Closes #5392 and #5393

I implemented the pop/swap methods for TrieMap/TreeMap/SmallIntMap, and I also updated all of them such that pop isn't just a remove/insert, but rather it's all done in one operation.

One thing I did notice is that with default methods it'd be really nice to define `insert` and `remove` in terms of `pop` and `swap` (or vice versa, just to have them available).
2013-05-06 23:06:36 -07:00
Alex Crichton
393a409b5d Add pop() and swap() to the Map trait 2013-05-07 01:16:04 -04:00
bors
bf748e5001 auto merge of #6241 : thestinger/rust/rc, r=pcwalton
To provide a reference counted pointer type with deterministic
destruction once managed boxes are switched over to a garbage
collector. Unlike managed boxes, these can be moved instead of just
copied/cloned which is helpful for avoiding reference counts.

Needs #5601 to be fixed in order for safety to be provided without the current ugly workaround of making the pointers contain `Option<@()>` and `Option<@mut ()>` (which are just set to `None`).

@brson: r?
2013-05-06 22:00:37 -07:00
Daniel Micay
3d526d1af3 add task-local reference counted smart pointers
To provide a reference counted pointer type with deterministic
destruction once managed boxes are switched over to a garbage
collector. Unlike managed boxes, these can be moved instead of just
copied/cloned which is helpful for avoiding reference counts.
2013-05-06 17:03:20 -04:00
Niko Matsakis
2e4790ca06 Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freeze 2013-05-06 16:10:31 -04:00
Brian Anderson
3cafe905a4 std: Workaround bustage on incoming. #6122 2013-05-06 12:28:51 -07:00
Niko Matsakis
84f7ecce5c Adust arena test: can no longer allocate recursively 2013-05-06 09:56:17 -04:00
Brendan Zabarauskas
0211833008 Move FuzzyEq trait into core::cmp and rename it to 'ApproxEq' 2013-05-06 21:51:07 +10:00
Niko Matsakis
4300d4d2fa Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freeze
Conflicts:
	src/libcore/core.rc
	src/libcore/hashmap.rs
	src/libcore/num/f32.rs
	src/libcore/num/f64.rs
	src/libcore/num/float.rs
	src/libcore/num/int-template.rs
	src/libcore/num/num.rs
	src/libcore/num/strconv.rs
	src/libcore/num/uint-template.rs
	src/libcore/ops.rs
	src/libcore/os.rs
	src/libcore/prelude.rs
	src/libcore/rt/mod.rs
	src/libcore/unstable/lang.rs
	src/librustc/driver/session.rs
	src/librustc/middle/astencode.rs
	src/librustc/middle/borrowck/check_loans.rs
	src/librustc/middle/borrowck/gather_loans.rs
	src/librustc/middle/borrowck/loan.rs
	src/librustc/middle/borrowck/preserve.rs
	src/librustc/middle/liveness.rs
	src/librustc/middle/mem_categorization.rs
	src/librustc/middle/region.rs
	src/librustc/middle/trans/base.rs
	src/librustc/middle/trans/inline.rs
	src/librustc/middle/trans/reachable.rs
	src/librustc/middle/typeck/check/_match.rs
	src/librustc/middle/typeck/check/regionck.rs
	src/librustc/util/ppaux.rs
	src/libstd/arena.rs
	src/libstd/ebml.rs
	src/libstd/json.rs
	src/libstd/serialize.rs
	src/libstd/std.rc
	src/libsyntax/ast_map.rs
	src/libsyntax/parse/parser.rs
	src/test/compile-fail/borrowck-uniq-via-box.rs
	src/test/compile-fail/regions-infer-borrow-scope-within-loop.rs
	src/test/run-pass/borrowck-nested-calls.rs
2013-05-05 15:11:04 -04:00
Brian Anderson
8081e8debf Register snapshots 2013-05-04 15:43:51 -07:00
bors
1f65e4a1d5 auto merge of #6230 : thestinger/rust/whitespace, r=catamorphism
I just had `git apply` fix most of them and then did a quick skim over the diff to fix a few cases where it did the wrong thing (mostly replacing tabs with 4 spaces, when someone's editor had them at 8 spaces).
2013-05-04 00:48:37 -07:00
bors
a47e4cb22f auto merge of #6229 : catamorphism/rust/warning-police, r=catamorphism 2013-05-03 23:48:36 -07:00
Daniel Micay
86efd97a10 add gitattributes and fix whitespace issues 2013-05-03 20:01:42 -04:00
Tim Chevalier
18bf9bd55a std: Warning police 2013-05-03 16:56:33 -07:00
Tim Chevalier
376a5526a7 tidy 2013-05-03 16:06:07 -07:00
Tim Chevalier
4d4cabff9e rustpkg: Implement install command
The install command should work now, though it only installs
    in-place (anything else has to wait until I implement RUST_PATH).

Also including:
    core: Add remove_directory_recursive, change copy_file

    Make copy_file preserve permissions, and add a remove_directory_recursive
    function.
2013-05-03 16:06:07 -07:00
bors
d9c7d0bc93 auto merge of #6185 : gifnksm/rust/prelude-from_str, r=graydon
`core::prelude`  re-exports `core::to_str::ToStr`, but doesn't re-export `core::from_str::FromStr`.
That is inconsistent.
2013-05-03 08:15:38 -07:00
gifnksm
e34a7ecbab Remove extra #[cfg(stage0)] 2013-05-03 15:57:05 +09:00
Brian Anderson
76f7207af2 std: xfail test_serializing_pipes 2013-05-02 22:18:16 -07:00
Patrick Walton
dc5df61bc1 librustc: Update the serializer to work properly with INHTWAMA, removing mutable fields in the process 2013-05-02 17:00:51 -07:00
Patrick Walton
6f2e429041 libstd: De-mut arena 2013-05-02 16:00:10 -07:00
gifnksm
cff6aba76e libcore: Export core::from_str::FromStr from core::prelude 2013-05-02 20:42:54 +09:00
Felix S. Klock II
a636f5160a More cases of [cfg(test)] instead of [test]. 2013-05-02 08:55:08 +02:00
Felix S. Klock II
880e300ed7 mod items need to be marked with cfg(test) not test. 2013-05-02 08:55:08 +02:00
Brendan Zabarauskas
e596128bd8 Remove 'Local Variable' comments 2013-05-02 13:22:04 +10:00
gifnksm
046a285a4b libstd: impl Clone for BigUint/BigInt and replace copy with .clone() 2013-05-02 07:17:29 +09:00
Niko Matsakis
d96c65afc8 keep old sort for stage0 2013-05-01 08:50:04 -04:00
Niko Matsakis
5ab33a2975 correct incorrect handling of overloaded operators, exposing various other bits of rot 2013-05-01 08:49:48 -04:00
bors
f67239fac3 auto merge of #6147 : bjz/rust/numeric-traits, r=brson
After much discussion on IRC and #4819, we have decided to revert to the old naming of the `/` operator. This does not change its behavior. In making this change, we also have had to rename some of the methods in the `Integer` trait. Here is a list of the methods that have changed:

- `Quot::quot` -> `Div::div`
- `Rem::rem` - stays the same
- `Integer::quot_rem` -> `Integer::div_rem`
- `Integer::div` -> `Integer::div_floor`
- `Integer::modulo` -> `Integer::mod_floor`
- `Integer::div_mod` -> `Integer::div_mod_floor`
2013-05-01 01:51:35 -07:00