Commit Graph

1562 Commits

Author SHA1 Message Date
Patrick Walton
a38cbebd8c libstd: Remove fn@, fn~, and fn& from libstd. rs=defun 2013-03-02 16:49:31 -08:00
Patrick Walton
a3f728238b librustc: Forbid chained imports and fix the logic for one-level renaming imports 2013-03-02 16:49:30 -08:00
bors
2304fe6208 auto merge of #5196 : thestinger/rust/ord, r=catamorphism
This allows `TreeMap`/`TreeSet` to fully express their requirements and reduces the comparisons from ~1.5 per level to 1 which really helps for string keys.

I also added `ReverseIter` to the prelude exports because I forgot when I originally added it.
2013-03-02 05:15:39 -08:00
Daniel Micay
035233a259 treemap: reimplement using TotalOrd 2013-03-02 14:10:19 -05:00
bors
5aca7d6aef auto merge of #5137 : yjh0502/rust/empty_struct, r=nikomatsakis
The fix is straight-forward, but there are several changes
while fixing the issue.

1) disallow `mut` keyword when making a new struct

In code base, there are following code,

```rust
struct Foo { mut a: int };
let a = Foo { mut a: 1 };
```

This is because of structural record, which is
deprecated corrently (see issue #3089) In structural
record, `mut` keyword should be allowd to control
mutability. But without structural record, we don't
need to allow `mut` keyword while constructing struct.

2) disallow structural records in parser level
This is related to 1). With structural records, there
is an ambiguity between empty block and empty struct
To solve the problem, I change parser to stop parsing
structural records. I think this is not a problem,
because structural records are not compiled already.

Misc. issues

There is an ambiguity between empty struct vs. empty match stmt.
with following code,

```rust
match x{} {}
```

Two interpretation is possible, which is listed blow

```rust
match (x{}) {} //  matching with newly-constructed empty struct
(match x{}) {}  //  matching with empty enum(or struct) x
                //  and then empty block
```

It seems that there is no such code in rust code base, but
there is one test which uses empty match statement:
https://github.com/mozilla/rust/blob/incoming/src/test/run-pass/issue-3037.rs

All other cases could be distinguished with look-ahead,
but this can't be. One possible solution is wrapping with
parentheses when matching with an uninhabited type.

```rust
enum what { }
fn match_with_empty(x: what) -> ~str {
    match (x) { //use parentheses to remove the ambiguity
    }
}
```
2013-03-02 04:21:38 -08:00
bors
36e898962d auto merge of #5185 : ben0x539/rust/net-tcp-docs, r=brson
This changes various type_names to TypeNames and fixes the example for `tcp::accept` that was still using the old `match` syntax and `{|args| ...}` closures.

The `accept` example was fairly outdated. I was just going to stay away from all the IO things until the scheduler revamp lands, but `accept` is probably one of the obvious starting points for networking stuff for a learner, and I don't want to get in the way of anyone's enthusiasm.

Doesn't touch non-comment lines, so I hope I will get away without learning about unit tests. It doesn't seem like the test system is set up to extract tests from doc comments right now.
2013-03-01 20:51:40 -08:00
Jihyun Yu
95bc9ea26d Remove REC, change related tests/docs 2013-03-02 12:57:05 +09:00
Brian Anderson
bcf626812b Rename core::private to core::unstable. #4743 2013-03-01 14:55:47 -08:00
Benjamin Herr
228e83888b std::net::tcp docs: Use current syntax and types
Doesn't touch non-comment lines. This changes various type_names to TypeNames
and fixes the example for `tcp::accept` that was still using the old
`match` syntax and `{|args| ...}` closures.
2013-03-01 22:32:24 +01:00
Patrick Walton
9519ee5d80 librustc: "APL2" -> "ASL2". rs=license-fix 2013-03-01 08:41:31 -08:00
Patrick Walton
c355f17943 Merge remote branch 'sevrak/issue-5164' into incoming 2013-03-01 08:39:02 -08:00
bors
a660bb362c auto merge of #5180 : catamorphism/rust/post-snapshot, r=catamorphism
* Disallow structural records everywhere
* Remove all #[cfg(stage0)] stuff
* Remove the last deprecated modes in libcore
* Un-xfail a test
2013-02-28 22:45:37 -08:00
bors
b7e72974dc auto merge of #5147 : nikomatsakis/rust/remove-legacy-trait-table, r=nikomatsakis
r? @pcwalton
2013-02-28 21:39:39 -08:00
Tim Chevalier
6b6d15ac20 Remove code that was awaiting a snapshot
* Disallow structural records everywhere
* Remove all #[cfg(stage0)] stuff
* Remove the last deprecated modes in libcore
* Un-xfail a test
2013-02-28 20:30:50 -08:00
Niko Matsakis
4ecb672d7f Remove legacy object creation mode, and convert remaining uses of it 2013-02-28 20:28:04 -05:00
bors
916d1a9165 auto merge of #5176 : brson/rust/unwrap_shared_mutable_state, r=nikomatsakis
r?

This fixes the current [random failures](http://buildbot.rust-lang.org/builders/auto-linux/builds/291/steps/test/logs/stdio) on the bots and closes #4436 by removing `unwrap_shared_mutable_state` and the code that depends on it. The result is that ARC-like things will not be unwrappable. This feature is complex and is not used outside of test cases.

Note that there is not consensus to remove it.

(second commit)
2013-02-28 17:21:40 -08:00
Brian Anderson
78d5091a4f core: Remove unwrap_shared_mutable_state. #4436 2013-02-28 15:20:40 -08:00
Alex Crichton
2df07ddc25 Fix implicit leaks of imports throughout libraries
Also touch up use of 'pub' and move some tests around so the tested functions
don't have to be 'pub'
2013-02-28 18:00:34 -05:00
Patrick Walton
2859c1ac6d librustc: Enforce cross-crate method privacy 2013-02-28 11:32:26 -08:00
Patrick Walton
107bf96ff0 librustc: Mark all type implementations public. rs=impl-publicity 2013-02-28 11:32:24 -08:00
sevrak
833ad6018e Fix license attribute on crates 2013-02-28 13:34:01 +00:00
bors
c705440ee3 auto merge of #5155 : bstrie/rust/dedrop, r=pcwalton
This removes all but 6 uses of `drop {}` from the entire codebase. Removing any of the remaining uses causes various non-trivial bugs; I'll start reporting them once this gets merged.
2013-02-27 23:30:40 -08:00
Ben Striegel
43d43adf6b Turn old drop blocks into Drop traits 2013-02-27 19:14:19 -05:00
bors
6ebc761f99 auto merge of #5140 : yjh0502/rust/issue_4458, r=catamorphism
Fix is a bug fix for issue #4458.

This patch is quite straight-forward. A test for result_str() is added.
2013-02-27 15:45:41 -08:00
Patrick Walton
07c3f5c0de librustc: Forbid pub or priv before trait implementations 2013-02-27 09:40:16 -08:00
Patrick Walton
573a31dfa7 libsyntax: Forbid mutable vectors. rs=demuting 2013-02-27 09:40:16 -08:00
Patrick Walton
8d7e6ef772 libsyntax: Forbid ~mut and ~const. rs=demuting 2013-02-27 09:40:15 -08:00
Jihyun Yu
5ae9b2949f Fix: now sha1 result_str() return correct value 2013-02-27 22:48:55 +09:00
bors
8e492ccaa7 auto merge of #5123 : thestinger/rust/treemap, r=nikomatsakis
* replace the dual next() and get() calls with a single next() function
* drop one of the pointer members from the struct
* add a method for using the lazy iterator with a for loop
2013-02-27 05:18:39 -08:00
Daniel Micay
5b0a2d1fc0 treemap: improve the lazy iterator
* replace the dual next() and get() calls with a single next() function
* drop one of the pointer members from the struct
* add a method for using the lazy iterator with a for loop
2013-02-27 05:30:15 -05:00
bors
0e6d895ed8 auto merge of #5119 : Kimundi/rust/incoming, r=catamorphism
Removed deprecated `str()` functions in int-template.rs and uint-template.rs
2013-02-26 10:54:39 -08:00
Marvin Löbel
42b0bacd76 Removed deprecated str() functions in int-template.rs and uint-template.rs 2013-02-26 16:38:30 +01:00
Patrick Walton
e2f90091cf libcore: Move Cell to core and de-~mut core and std 2013-02-26 04:18:12 -08:00
Patrick Walton
c483aab4ae librustc: Implement a lint mode for mutable structures; deny by default. r=tjc 2013-02-26 04:18:11 -08:00
Daniel Micay
1afddff97f remove oldsmallintmap
Closes #4738
2013-02-23 01:40:17 -05:00
bors
c316189d15 auto merge of #5081 : brson/rust/pipes, r=pcwalton
r?
2013-02-22 11:24:38 -08:00
Brian Anderson
dab6a85230 core: Extract comm from pipes. #4742 2013-02-21 17:36:54 -08:00
John Clements
27b06777e6 Cleanup, commenting, trivial renaming 2013-02-21 16:17:06 -08:00
Patrick Walton
c0defda499 librustc: Separate the rest of the trait bounds with + and stop parsing space-separated ones. rs=plussing 2013-02-21 08:29:48 -08:00
Patrick Walton
bf2a225c0b librustc: Separate most trait bounds with '+'. rs=plussing 2013-02-20 21:14:20 -08:00
Graydon Hoare
acc147769e std: update rand-using tests, r=burningtree 2013-02-19 07:38:18 -08:00
bors
6351515d98 auto merge of #5005 : alexcrichton/rust/bitv++, r=catamorphism
These commits take the old bitv implementation and modernize it with an explicit self, some minor touchups, and using what I think is some more recent patterns (like `::new` instead of `Type()`).

Additionally, this adds an implementation of `container::Set` on top of a bit vector to have as a set of `uint`s. I initially tried to parameterize the type for the set to be `T: NumCast` but I was hitting build problems in stage0 which I think means that it's not in a snapshot yet, so it's just hardcoded as a set of `uint`s now. In the future perhaps it could be parameterized. I'm not sure if it would really add anything, though, so maybe it's nicer to be hardcoded anyway.

I also added some extra methods to do normal bit vector operations on the set in-place, but these aren't a part of the `Set` trait right now. I haven't benchmarked any of these operations just yet, but I imagine that there's quite a lot of room for optimization here and there.
2013-02-18 18:40:33 -08:00
Alex Crichton
cf2ddf0437 Add benchmarks to measure differences in bit vectors 2013-02-18 01:24:14 -05:00
Alex Crichton
bf8ed45adc Implement Set container on top of a bit vector 2013-02-17 23:09:21 -05:00
Alex Crichton
393a4b41f6 Favor local closures instead of global functions 2013-02-17 23:09:21 -05:00
Alex Crichton
dc7e6abab7 Remove the 'uint_bits' constant in bitv 2013-02-17 23:09:21 -05:00
Alex Crichton
a01ef8ef87 Change SmallBitv to use uint instead of u32 2013-02-17 23:09:20 -05:00
Alex Crichton
91fae27912 Modernize bitv mut fields and explicit self 2013-02-17 23:09:20 -05:00
Daniel Micay
6956e81c9b vec: grow_fn doesn't require Copy 2013-02-17 14:09:09 -05:00
bors
a6945f2a45 auto merge of #4993 : thestinger/rust/deque, r=graydon
Closes #3748 and #2343.
2013-02-16 23:30:38 -08:00
Seth Pink
60bd4a5385 Removed more capture claueses. 2013-02-17 12:41:45 +10:00
Daniel Micay
8b38e07f24 deque: get rid of Copy requirement
Closes #3748
2013-02-16 21:35:09 -05:00
Daniel Micay
5aa0463564 deque: avoid Copy in grow 2013-02-16 21:34:09 -05:00
Daniel Micay
a257329071 deque: avoid Copy for get 2013-02-16 20:51:04 -05:00
Seth Pink
1f4c758f9b Remove use of capture clause #4965 2013-02-17 11:02:23 +10:00
Daniel Micay
6190661018 deque: avoid Copy in pop_{front,back} 2013-02-16 19:44:58 -05:00
Daniel Micay
373c072e83 deque: avoid Copy in peek_{front,back} 2013-02-16 19:10:10 -05:00
Daniel Micay
5929f15999 deque: avoid Copy in the get function 2013-02-16 19:05:27 -05:00
Daniel Micay
5832fe968f deque: separate the methods that need Copy 2013-02-16 19:00:51 -05:00
Daniel Micay
15879d3f74 deque: rm old return statements 2013-02-16 18:57:45 -05:00
Daniel Micay
ed7c9c4e2a add a Mutable implementation (clear) to std::deque 2013-02-16 18:57:01 -05:00
Daniel Micay
b47e1e9eda modernize std::deque
* use a proper exported data type with private fields
* implement core::container::Container
* use the current constructor convention
* use explicit self
* get rid of DVec and the mutable fields

Closes #2343
2013-02-16 18:20:54 -05:00
Graydon Hoare
585d6f7b00 rustpkg: Massage for landing. 2013-02-15 18:50:51 -08:00
Zack Corr
b10dc1af06 Move semver to std and finish rustpkg 2013-02-15 18:04:10 -08:00
Zack Corr
2192d11cd1 Correct Zack Corr's email in AUTHORS.txt 2013-02-15 18:04:10 -08:00
Patrick Walton
bb833ca0f0 librustc: Stop parsing impl Type : Trait and fix several declarations that slipped through. r=tjc 2013-02-15 16:59:56 -08:00
bors
566bcf2225 auto merge of #4969 : nickdesaulniers/rust/issue3869, r=brson
Issue #3869
review? @nikomatsakis 

Convert all uses of vec::slice to vec::view Issue #3869
Rename const_view to const_slice
Renamed mut_view to mut_slice
Fix windows build error.  `buf` is borrowed by the call to
`as_mut_buf()` and so we must invoke `slice()` outside of that
call.
2013-02-15 13:54:49 -08:00
Luqman Aden
03757482f0 libstd: Fix broken test. 2013-02-15 02:49:54 -08:00
Luqman Aden
4cf51c2531 libstd: Get rid of move. 2013-02-15 02:49:54 -08: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
bors
af2f0ef088 auto merge of #4927 : sanxiyn/rust/remove-dvec, r=catamorphism 2013-02-14 17:23:18 -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
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
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
Nick Desaulniers
4445b38df2 Remove die!, raplace invocations with fail! Issue #4524 pt 3 2013-02-13 17:01:32 -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
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
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
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
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
bors
210fa2d017 auto merge of #4874 : thestinger/rust/option, r=catamorphism 2013-02-12 10:35:12 -08:00
Brian Anderson
9701517703 std: Fix uv_tcp_t size on i686-apple-darwin 2013-02-11 19:24:35 -08:00
Brian Anderson
b126c742e5 Merge remote-tracking branch 'thestinger/treemap' 2013-02-11 16:13:50 -08: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
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
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
73507c1961 std: strip sillyness from debug comment in iotask teardown 2013-02-10 11:51:05 -08:00
Jeff Olson
dfcdb6eb72 rt/std: update of libuv API glue for libuv submodule update 2013-02-10 11:51:05 -08:00
John Clements
c05954a76b added issue for reference in FIXME 2013-02-10 11:25:46 -08:00
bors
2fc1f41d0d auto merge of #4827 : mcpherrinm/rust/master, r=catamorphism
It seems to me the library needs more work to be done, but having a non-compilable sample program seems like bad news.
2013-02-09 17:28:04 -08:00
bors
d6442e97a5 auto merge of #4854 : thestinger/rust/oldmap, r=catamorphism 2013-02-09 15:02:51 -08:00
John Clements
7736ed6c62 json tidy 2013-02-09 13:37:05 -08:00
John Clements
c952c04462 re-special-case Option in JSON encoding 2013-02-09 13:37:05 -08:00
John Clements
f91160b687 json add enum encoder test case 2013-02-09 13:37:04 -08:00
John Clements
0e9495b980 json bugfix 2013-02-09 13:37:04 -08:00
John Clements
394f8eeb7e tidy 2013-02-09 13:37:04 -08:00
John Clements
fe82374328 json bugfixes 2013-02-09 13:37:04 -08:00
John Clements
765961438d fix typos in sample code, add enum to json encoder, add test case 2013-02-09 13:37:04 -08:00
bors
d90abd5879 auto merge of #4848 : nikomatsakis/rust/issue-4821-bad-kind-computation, r=catamorphism
...ear

values to be copied.  Rewrite kind computation so that instead of directly
computing the kind it computes what kinds of values are present in the type,
and then derive kinds based on that. I find this easier to think about.

Fixes #4821.

r? @catamorphism
2013-02-09 10:20:55 -08:00
Matthew McPherrin
0a062b50f1 Remove trailing whitespace 2013-02-08 20:17:50 -05:00
Daniel Micay
94fd95a4f1 oldmap: rm unneeded unsafe 2013-02-08 19:30:54 -05:00
Daniel Micay
0127828b5b oldmap: separate out the methods that need Copy 2013-02-08 19:20:36 -05:00
Daniel Micay
a32c5c73ee oldmap: get rid of legacy _ref suffixes 2013-02-08 19:12:51 -05:00
Matthew McPherrin
46df7985a5 Merge branch 'master' of https://github.com/mozilla/rust 2013-02-08 15:21:46 -05:00
Niko Matsakis
a380df809c Fix subtle error in caching during kind computation that could cause linear
values to be copied.  Rewrite kind computation so that instead of directly
computing the kind it computes what kinds of values are present in the type,
and then derive kinds based on that. I find this easier to think about.

Fixes #4821.
2013-02-08 07:20:39 -08:00
Daniel Micay
8c32cd2dc8 fix map tests 2013-02-07 22:58:16 -05:00
Daniel Micay
9599cc86f0 implement BaseIter for LinearMap 2013-02-07 22:28:58 -05:00
Daniel Micay
fe841f3e56 implement ReverseIter for SmallIntMap 2013-02-07 22:04:38 -05:00
Daniel Micay
a2f922f282 implement ReverseIter for TreeMap and TreeSet 2013-02-07 22:04:38 -05:00
Daniel Micay
66d5030763 implement BaseIter for SmallIntMap 2013-02-07 22:04:38 -05:00
Daniel Micay
e018244777 make Option's map and map_default use a lifetime 2013-02-07 22:04:38 -05:00
Daniel Micay
f6e0df6563 implement BaseIter for TreeMap 2013-02-07 22:04:37 -05:00
Daniel Micay
83270d2d79 rm each method from the Map trait
the map types should implement BaseIter instead
2013-02-07 22:04:35 -05:00
Daniel Micay
d903231f1e add a BaseIter implementation for PriorityQueue 2013-02-07 20:18:15 -05:00
Patrick Walton
472797b04a librustc: Lots of de-muting. rs=demuting 2013-02-07 16:17:39 -08:00
bors
37a610a7d9 auto merge of #4831 : bjz/rust/incoming, r=pcwalton
This is useful for comparing more complex types that include floats.
2013-02-07 08:32:09 -08:00
Niko Matsakis
a32498d846 Make ~fn non-copyable, make &fn copyable, split barefn/closure types,
correct handling of moves for struct-record update.

Part of #3678.  Fixes #2828, #3904, #4719.
2013-02-07 05:53:30 -08:00
Brendan Zabarauskas
17a14fe0e9 Merge branch 'incoming' of https://github.com/mozilla/rust into incoming 2013-02-07 22:55:23 +11:00
Brendan Zabarauskas
e4c7d8ec87 Add type parameter for epsilon value 2013-02-07 22:54:52 +11:00
Matthew McPherrin
64fedfbc4e Fix sample program to compile in modern rust 2013-02-06 23:42:55 -05:00
Brendan Zabarauskas
b081f59495 Convert fuzzy_epsilon constant to upper case and make public 2013-02-07 10:25:41 +11:00
Daniel Micay
dab2f2fac0 remove old snapshot workaround from smallintmap 2013-02-06 17:37:56 -05:00
Daniel Micay
bdfb930f34 treemap: make map_next and set_next public 2013-02-06 17:37:56 -05:00
Daniel Micay
1694168783 update treemap FIXME 2013-02-06 17:37:56 -05:00
Daniel Micay
37e998696f get rid of implicit vec copies in treemap iterator
Each call to next() was doing a copy rather than a move. There's
currently no way for this to be a method that uses &mut self, so it has
to be a free function. Closes #4763.
2013-02-06 17:37:56 -05:00
Daniel Micay
5b6c26b4e4 treemap: get rid of some implicit vector copies 2013-02-06 17:37:56 -05:00
Daniel Micay
b91a51daca remove issue #3148 workarounds (no longer needed) 2013-02-06 17:37:56 -05:00
Patrick Walton
801f3225b2 oldmap: use &K instead of K in find and get
This reverts commit a4250a96fd.

This is not the cause of the nonexhaustive-match failure.
2013-02-05 19:41:45 -08:00
Graydon Hoare
a4250a96fd Revert "oldmap: use &K instead of K in find and get"
This reverts commit 8e643525d4.
2013-02-05 14:30:53 -08:00
Tim Chevalier
33e2c979ce Merge branch 'incoming' into removing 2013-02-05 10:33:35 -08:00
Tim Chevalier
2dcb3ed745 Merge 2013-02-05 10:33:28 -08:00
bors
f1b05ece93 auto merge of #4796 : catamorphism/rust/derecord_std, r=catamorphism
See #4665
2013-02-05 07:04:15 -08:00
bors
80cd485b49 auto merge of #4784 : alexcrichton/rust/bitv-clear-fix, r=graydon
I think that the inversion of `op(&mut w)` may have just been a mistake?
2013-02-04 22:39:53 -08:00
Alex Crichton
406a73fde2 Fix the each_storage() iterator on big bit vectors 2013-02-04 22:59:33 -05:00
bors
bffe3088c7 auto merge of pull req #4777 from thestinger/rust, r=graydon 2013-02-04 17:24:40 -08:00
Tim Chevalier
73a7672b8d std: Stamp out structural records
See #4665
2013-02-04 16:48:52 -08:00
Brian Anderson
e08a805b30 Merge remote-tracking branch 'bstrie/rimov' into incoming
Conflicts:
	src/libsyntax/parse/parser.rs
	src/test/bench/graph500-bfs.rs
	src/test/bench/sudoku.rs
	src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs
	src/test/run-pass/empty-mutable-vec.rs
	src/test/run-pass/foreach-nested.rs
	src/test/run-pass/swap-2.rs
2013-02-04 11:58:30 -08:00
Erick Tryzelaar
9adfa59d8e core: convert ToStr::to_str to take explicit &self 2013-02-03 20:47:26 -08:00
Daniel Micay
8e643525d4 oldmap: use &K instead of K in find and get 2013-02-03 23:30:56 -05:00
Brian Anderson
3b396d17d6 Merge remote-tracking branch 'thestinger/old_map' into incoming
Conflicts:
	src/test/bench/core-map.rs
2013-02-03 17:56:49 -08:00
Marvin Löbel
af4972f3ce Fixed fmt!, tests, doc-tests. 2013-02-03 15:37:25 -08:00
Marvin Löbel
a612e49a21 Converted the floating point types to the new string conversion functions.
Also fixed all conflicting calls of the old functions in the rest of the codebase.

The set of string conversion functions for each float type now consists of those items:
- to_str(), converts to number in base 10
- to_str_hex(), converts to number in base 16
- to_str_radix(), converts to number in given radix
- to_str_exact(), converts to number in base 10 with a exact number of trailing digits
- to_str_digits(), converts to number in base 10 with a maximum number of trailing digits
- implementations for to_str::ToStr and num::ToStrRadix
- from_str(), parses a string as number in base 10 including decimal exponent and special values
- from_str_hex(), parses a string as a number in base 16 including binary exponent and special values
- from_str_radix(), parses a string as a number in a given base excluding any exponent and special values
- implementations for from_str::FromStr and num::FromStrRadix
2013-02-03 15:37:24 -08:00
Marvin Löbel
7113fd150a Fixed tests still using old integer to_str
Fixed integer tests
2013-02-03 15:37:24 -08:00
Marvin Löbel
eb19462104 Converted libcore/uint-template.rs to the new string functions.
- Moved ToStr implementation of unsigned integers to uint-template.rs.
- Marked the `str()` function as deprecated.
- Forwarded all conversion functions to `core::num::to_str_common()`
  and `core::num::from_str_common()`.
- Fixed most places in the codebase where `to_str()` is being used.
- Added uint-template to_str and from_str overflow tests.
2013-02-03 15:37:24 -08:00
Daniel Micay
4fd9264875 oldmap: &K instead of K for the remove parameter 2013-02-03 18:20:59 -05:00
Daniel Micay
119c78073b oldmap: start conversion to explicit self 2013-02-03 15:55:11 -05:00
Daniel Micay
81b4f36d49 oldmap: remove legacy each method 2013-02-03 15:55:11 -05:00
Daniel Micay
2e496818a5 oldmap: get rid of the legacy each_key method 2013-02-03 15:55:10 -05:00
Daniel Micay
88d9d417a1 oldmap: remove the legacy each_value method 2013-02-03 15:55:10 -05:00
Daniel Micay
643479f2e5 oldmap: implement core::container::Mutable 2013-02-03 15:55:10 -05:00
Daniel Micay
1b4eb145f9 oldmap: implement core::container::Container 2013-02-03 15:55:10 -05:00
Daniel Micay
f4a27b2c7d oldmap: get rid of the legacy contains_key method 2013-02-03 15:55:10 -05:00
Daniel Micay
319eeb1c79 rename map -> oldmap and mark it as deprecated
LinearMap is quite a bit faster, and is fully owned/sendable without
requiring copies. The older std::map also doesn't use explicit self and
relies on mutable fields.
2013-02-03 15:55:10 -05:00
Daniel Micay
df31373406 rm commented out std::map code from json module
it was replaced by LinearMap
2013-02-03 15:55:09 -05:00
Daniel Micay
ed45354a95 remove old StdMap trait
this has been replaced by core::container::Map
2013-02-03 15:55:09 -05:00
Nick Desaulniers
6fb4239bb3 Replace most invocations of fail keyword with die! macro 2013-01-31 22:25:12 -08:00
Daniel Micay
74b317ddc2 modernize smallintmap
* switch to explicit self
* get rid of the @ box
* replace DVec with ~[] (to get rid of the mutable field)
* implement the new container::Map trait
2013-01-31 23:22:51 -05:00
Daniel Micay
348d770fed copy oldsmallintmap.rs to smallintmap.rs 2013-01-31 23:13:56 -05:00
Daniel Micay
70855f5a07 move smallintmap to oldsmallintmap 2013-01-31 23:13:56 -05:00
Daniel Micay
9ba7114515 implement container::Mutable for SmallIntMap 2013-01-31 23:13:56 -05:00
Daniel Micay
aac91267e3 clean up SmallIntMap tests a bit 2013-01-31 23:13:56 -05:00
Daniel Micay
1057eea7ac drop the StdMap implementation from SmallIntMap 2013-01-31 23:13:55 -05:00
Daniel Micay
274e75cd82 implement container::Container for SmallIntMap 2013-01-31 23:13:55 -05:00
Nick Desaulniers
aee7929469 Replace most invocations of fail keyword with die! macro 2013-01-31 20:12:49 -08:00
Tim Chevalier
793f20ad32 std: remove transitional code 2013-01-31 19:35:57 -08:00
Niko Matsakis
0682ad0eb9 Finalize moves-based-on-type implementation.
Changes:

- Refactor move mode computation
- Removes move mode arguments, unary move, capture clauses
  (though they still parse for backwards compatibility)
- Simplify how moves are handled in trans
- Fix a number of illegal copies that cropped up
- Workaround for bug involving def-ids in params
  (see details below)

Future work (I'll open bugs for these...):

- Improve error messages for moves that are due
  to bindings
- Add support for moving owned content like a.b.c
  to borrow check, test in trans (but I think it'll
  "just work")
- Proper fix for def-ids in params

Def ids in params:

Move captures into a map instead of recomputing.

This is a workaround for a larger bug having to do with the def-ids associated
with ty_params, which are not always properly preserved when inlining.  I am
not sure of my preferred fix for the larger bug yet.  This current fix removes
the only code in trans that I know of which relies on ty_param def-ids, but
feels fragile.
2013-01-31 12:09:00 -08:00
Ben Striegel
df36bfa758 Repair RIMOV damage to libstd tests 2013-01-30 23:21:57 -05:00
Ben Striegel
dafd759b20 Repair RIMOV damage to libstd 2013-01-30 23:21:16 -05:00
Ben Striegel
0336a8633f RIMOV, round 10
find ./ -type f -name "*.rs" -exec sed -i "s/~\[mut /~\[/g" {} \;
2013-01-30 23:19:08 -05:00
Ben Striegel
3e95a13577 RIMOV, round 8
find ./ -type f -name "*.rs" -exec sed -i "s/  \([a-zA-Z_]\+\): ~\[mut /
mut \1: ~\[/g" {} \;
2013-01-30 23:19:08 -05:00
Ben Striegel
b4f47eca2a RIMOV, round 7
find ./ -type f -name "*.rs" -exec sed -i "s/ mut \([a-zA-Z_]\+\):
~\[mut / mut \1: ~\[/g" {} \;
2013-01-30 23:18:08 -05:00
Ben Striegel
f08af9a7a5 RIMOV, round 5
find ./ -type f -name "*.rs" -exec sed -i "s/\&\[mut /\&mut \[/g" {} \;
2013-01-30 23:18:08 -05:00
Ben Striegel
12e8151fb0 RIMOV, round 4
find ./ -type f -name "*.rs" -exec sed -i "s/let mut \(.*\)\[mut[
]\?/let mut \1\[/g" {} \;
2013-01-30 23:16:56 -05:00
Ben Striegel
5577ce635f RIMOV, round 3
find ./ -type f -name "*.rs" -exec sed -i "s/let \(.*\)\[mut[ ]\?/let
mut \1\[/g" {} \;
2013-01-30 23:16:56 -05:00
Patrick Walton
366812a5c3 librustc: Change self as a type to Self everywhere. r=brson 2013-01-30 19:52:45 -08:00
Graydon Hoare
4030aaff20 rustc: make integral type inference transactional, close #3211, close #4401, close #3398. 2013-01-30 16:21:19 -08:00
Tim Chevalier
b927e48a26 Merge pull request #4682 from thestinger/treemap
Set trait improvements + minor treemap cleanup
2013-01-29 20:09:15 -08:00
Brian Anderson
da4b376897 std: Stop using oldcomm 2013-01-29 19:54:55 -08:00
Tim Chevalier
0aef28dd6d De-capitalize "note" to get rid of spurious tidy warnings 2013-01-29 19:26:55 -08:00
Daniel Micay
6b08683e15 add intersection and union to the Set trait 2013-01-29 22:24:00 -05:00
Daniel Micay
99eb4ddddd add difference and symmetric_difference to Set 2013-01-29 21:59:58 -05:00
Daniel Micay
42cafcee2c add is_disjoint to the Set trait 2013-01-29 21:30:55 -05:00
Daniel Micay
bfa9c9a00f add is_subset and is_superset to the Set trait 2013-01-29 21:30:55 -05:00
Daniel Micay
456af7a79d update comments documenting issue #4492 workaround 2013-01-29 21:30:55 -05:00
Daniel Micay
a388e2c1a4 treemap: rm a bit of redundant code 2013-01-29 21:30:55 -05:00
Tim Chevalier
a80a65b3b7 Merge pull request #4676 from thestinger/fuzzy
fix FuzzyEq
2013-01-29 13:58:39 -08:00
Daniel Micay
1aa9fdff56 fix FuzzyEq 2013-01-29 16:54:55 -05:00
Tim Chevalier
66b07f1e5d Fix licenseck to allow 2012-2013 as the year range 2013-01-29 13:48:40 -08:00
Tim Chevalier
5e77d55326 Merge pull request #4664 from thestinger/fuzzy
FuzzyEq improvements
2013-01-29 13:36:43 -08:00
Daniel Micay
e0728d41f2 implement fuzzy_eq with fuzzy_eq_eps 2013-01-29 15:35:26 -05:00
Patrick Walton
f1ddb2a32c libstd: De-export libstd. rs=deexport 2013-01-29 12:06:09 -08:00
Patrick Walton
226cd68f13 librustc: De-implicit-self the visitor. r=graydon 2013-01-29 10:43:12 -08:00