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
Patrick Walton
6ce74460e6
librustc: Disallow trait bounds in types, enumerations, and structure definitions. r=tjc
2013-01-29 10:42:58 -08:00
Patrick Walton
eb4d39e1fe
libstd: Remove "dual impls" from the language and enforce coherence rules. r=brson
...
"Dual impls" are impls that are both type implementations and trait
implementations. They can lead to ambiguity and so this patch removes them
from the language.
This also enforces coherence rules. Without this patch, records can implement
traits not defined in the current crate. This patch fixes this, and updates
all of rustc to adhere to the new enforcement. Most of this patch is fixing
rustc to obey the coherence rules, which involves converting a bunch of records
to structs.
2013-01-29 10:42:45 -08:00
Tim Chevalier
31d78b2f07
Add #[legacy_records] crate attribute
...
In rustc, rustdoc, rusti, syntax, and std.
2013-01-28 19:41:56 -08:00
Daniel Micay
fce6446e7e
add a FuzzyEq method that accepts an epsilon value
2013-01-28 21:25:58 -05:00
Tim Chevalier
3a6849f36b
Revert "Revert "Merge pull request #4633 from thestinger/treemap""
...
This reverts commit d73077f82d
.
2013-01-28 17:20:29 -08:00
Daniel Micay
abb79cb52d
update FuzzyEq to explicit self
2013-01-28 19:28:40 -05:00
Daniel Micay
52975202af
fix std::cmp docstring
2013-01-28 19:28:23 -05:00
Brian Anderson
d9170e14b1
Tidy
2013-01-28 14:41:20 -08:00
Michael Neumann
1ecdf3abc1
Greatly improve performance for TcpSocketBuf.read
...
For every call to the read() function the internal buffer was copied
into a new buffer (minus the bytes copied into the result buffer). When
the internal buffer is large enough, this severely affects performance,
especially when read_line() is used which calls read_byte() (which calls
read()) for each read byte.
For line oriented I/O this wasn't all that bad, because the internal
buffers usually never were very big. The effect is much more visible
once the buffer grows larger.
Now we always first look into the internal buffer and copy as many bytes
as possible (and desired) into the result buffer. If we need more, we
call the socket read function and use the result as the new internal
buffer, then continue to copy from the (new) internal buffer, and so on.
2013-01-28 14:40:11 -08:00
Michael Neumann
0c3ef3cc6b
Convert log(debug, ...) to debug!(...)
2013-01-28 14:40:11 -08:00
Brian Anderson
2a48aef0a8
Merge remote-tracking branch 'thestinger/hashmap' into deriving
2013-01-28 14:28:59 -08:00
Brian Anderson
c75cc0aa10
Merge remote-tracking branch 'codeblack08/treemap-ord' into deriving
2013-01-28 14:15:58 -08:00
Daniel Micay
8eaf0737b7
get rid of LinearMap's find_copy method
2013-01-28 16:06:09 -05:00
Niko Matsakis
08bc19cbcd
Remove bounds from type decl of smallintmap
...
r=brson
2013-01-28 10:01:55 -08:00
Cody Schroeder
6a4d1855bf
std: implement lexicographical Ord for TreeMap/TreeSet
2013-01-26 16:39:17 -08:00
Brian Anderson
83ca034d2e
Merge remote-tracking branch 'brson/nocommupstream2'
2013-01-26 14:57:58 -08:00
Tyler Bindon
edc94f5c23
Fix Option camel case in xfailed/ignored tests
2013-01-25 19:42:23 -07:00
Tyler Bindon
3a5d2cdbf3
Fix Option camel case in comments
2013-01-25 19:42:23 -07:00
Brian Anderson
1ef83945c1
Merge remote-tracking branch 'brson/nocommupstream'
...
Conflicts:
src/libcore/private.rs
src/libcore/task/mod.rs
src/libcore/task/spawn.rs
src/libstd/net_tcp.rs
src/libstd/uv_global_loop.rs
src/libstd/uv_iotask.rs
2013-01-25 18:06:30 -08:00
Cody Schroeder
265b33c239
Declare std::arc::unwrap to be pub
2013-01-25 17:25:41 -08:00
Graydon Hoare
10eb620537
register snapshots
2013-01-25 15:06:07 -08:00
Tim Chevalier
d73077f82d
Revert "Merge pull request #4633 from thestinger/treemap"
...
I was too hasty in merging -- this needs a snapshot.
This reverts commit 4a7e1ab374
, reversing
changes made to e447521c1c
.
2013-01-25 13:39:04 -08:00
Tim Chevalier
85a34c2898
Merge pull request #4625 from thestinger/container
...
more little container improvements
2013-01-25 11:57:51 -08:00
Daniel Micay
ca8f09a39e
use mut function argument syntax in priority_queue
2013-01-25 13:28:43 -05:00
Daniel Micay
aff3db26aa
use mutable function argument syntax in treemap
2013-01-25 10:55:18 -05:00
Brian Anderson
19aa88cd64
Stop using oldcomm in uv_global_loop tests
2013-01-24 23:55:11 -08:00
Tim Chevalier
e447521c1c
std: Mop up Mac/Linux breakage
2013-01-24 22:02:09 -08:00
Daniel Micay
e4337a9def
remove remaining is_not_empty functions/methods
2013-01-24 23:24:57 -05:00
Tim Chevalier
d191e89d9e
std: Fix broken Windows function
2013-01-24 20:12:07 -08:00
Daniel Micay
d95c9cbe38
replace ConstVector trait with the Container trait
2013-01-24 23:02:44 -05:00
Tim Chevalier
9898485d4f
Merge pull request #4613 from erickt/incoming
...
convert most of libcore and libstd to structs, work around tzset race
2013-01-24 17:24:45 -08:00
Tim Chevalier
f19e16881e
syntax/rustc: Less copy
2013-01-24 16:45:20 -08:00
Erick Tryzelaar
3c24419c19
time tests are racing on tzset, so merge the tests together.
...
This attempts to fix issue #3327 .
2013-01-24 16:24:31 -08:00
Erick Tryzelaar
e84576b888
convert most of libstd over to structs
2013-01-24 16:24:31 -08:00
Patrick Walton
ad25e208ee
librustc: Allow &mut
to be loaned; allow self
to be loaned; make &mut
loanable to &
. r=nmatsakis
2013-01-24 13:52:22 -08:00
Patrick Walton
bbbb80559c
librustc: Disallow &mut
loans from overlapping with any other loans
2013-01-24 13:52:21 -08:00
Patrick Walton
163b97b7bb
librustc: Make C functions unsafe
2013-01-24 13:52:21 -08:00
Tim Chevalier
e43cff6657
Merge pull request #4616 from thestinger/priority_queue
...
remove is_not_empty method from PriorityQueue
2013-01-24 12:16:03 -08:00
Daniel Micay
d912d53ea9
remove is_not_empty method from PriorityQueue
2013-01-24 14:46:09 -05:00
Daniel Micay
acde90dc1c
remove old LinearMap constructor
2013-01-24 13:36:04 -05:00
Tim Chevalier
a202dcccca
Merge pull request #4594 from thestinger/map
...
more work on the map trait and TreeMap/LinearMap
2013-01-23 20:10:47 -08:00
Daniel Micay
bba5520d62
fix tests
2013-01-23 21:46:33 -05:00
Brian Anderson
a3e087cefa
core: Remove private::chan_from_global_ptr. #3915
2013-01-23 17:35:34 -08:00
Brian Anderson
b9608fe423
std: Convert uv_global_loop to use pipes
2013-01-23 17:35:34 -08:00
Daniel Micay
7f0fa143bc
switch LinearMap to current constructor convention
2013-01-23 18:01:24 -05:00
Patrick Walton
54b2cad8b3
libsyntax: Remove fn() unsafe { ... }
. r=graydon
2013-01-23 14:41:08 -08:00
Daniel Micay
591eefd740
improve hashmap/treemap documentation
2013-01-23 16:47:27 -05:00
Daniel Micay
45c9f6a099
add find method to the core::container::Map trait
2013-01-23 14:25:06 -05:00
Daniel Micay
ee0a8c68ab
rename hashmap find_ref/get_ref -> find/get
2013-01-23 14:25:06 -05:00
Daniel Micay
203fcbd0f3
rename hashmap find/get -> find_copy/get_copy
2013-01-23 14:25:06 -05:00
Daniel Micay
bc96fe9c49
get rid of the std::map::Map LinearMap impl
...
This legacy trait needs to be dropped in order to migrate to
core::container::Map, which doesn't require @ and Copy, and will make
proper use of borrowed pointers.
2013-01-23 14:25:06 -05:00
Daniel Micay
b7ef28c33a
rename send_map to hashmap
...
This makes the module much more discoverable, and is in line with the
'treemap' naming.
2013-01-23 14:25:01 -05:00
Tim Chevalier
995ccc0d82
Merge pull request #4596 from Trinick/tomutrename
...
core: Rename to_mut and from_mut to cast_to_mut and cast_from_mut
2013-01-23 10:56:08 -08:00
Trinick
9dc8e96c5f
core: Rename to_mut and from_mut to cast_to_mut and cast_from_mut
2013-01-23 10:09:45 +00:00
Tim Chevalier
dfa97c21a5
Merge pull request #4586 from thestinger/treemap
...
drop is_not_empty from TreeSet/TreeMap
2013-01-22 23:08:18 -08:00
Graydon Hoare
93e969e356
std: un-ignore strptime test; fix bug introduced by 1a226f instead.
2013-01-22 21:42:24 -08:00
Daniel Micay
7eb8642aed
drop is_not_empty from TreeSet/TreeMap
2013-01-22 22:36:29 -05:00
Tim Chevalier
e31ebeadc1
std: Ignore time::tests::test_strptime, it's failing for some reason
...
I'll file an issue.
2013-01-22 19:09:21 -08:00
Graydon Hoare
499f00de1d
std: various hacking on workcache.
2013-01-22 17:55:36 -08:00
Tim Chevalier
1a226f5807
Merge pull request #4466 from ScriptDevil/master
...
Range checking and miscellaneous fixes tin time library
2013-01-22 16:10:48 -08:00
Tim Chevalier
e02449c41d
Merge pull request #4571 from thestinger/container
...
more work on container traits
2013-01-22 10:57:26 -08:00
Daniel Micay
6f4d86ed90
add a base Container trait
2013-01-22 08:10:08 -05:00
Daniel Micay
d635a6e506
add a container::Map trait
2013-01-22 08:10:08 -05:00
Daniel Micay
ffb9049274
add a Mutable container trait with clear
2013-01-22 08:09:53 -05:00
Chris Peterson
f5a3ce687d
Add Timespec comment and assert about negative nsec
2013-01-21 20:51:58 -08:00
Daniel Micay
66e50892c1
style fix
2013-01-21 21:27:21 -05:00
Tim Chevalier
0a8c039135
Merge pull request #4506 from thestinger/mkdtemp
...
clean up tempfile module and rm FIXME
2013-01-20 14:18:00 -08:00
Tim Chevalier
fa4f4fa673
Merge pull request #4519 from cpeterso/impl-timespec-ord
...
Implement Ord trait for Timespec
2013-01-20 14:15:29 -08:00
Daniel Micay
13d07ad0a6
add a Set trait and implement it for TreeSet
2013-01-20 14:58:19 -05:00
Alex Crichton
95d25ca47c
Fix the difference method on bit vectors
2013-01-19 20:17:12 -05:00
Brian Anderson
6b6acde972
Add a license check to tidy. #4018
2013-01-17 23:28:42 -08:00
Daniel Micay
c7abdd3847
re-borrow in heir_swap (fixes compile)
2013-01-17 16:54:12 -08:00
Daniel Micay
f7d9485331
indentation fix
2013-01-17 16:54:12 -08:00
Daniel Micay
3fe6faace8
make is_superset/is_subset O(n+m) instead of O(n*log(m))
2013-01-17 16:54:12 -08:00
Daniel Micay
4f92d8fb52
make intersection O(n+m) instead of O(n*log(m))
2013-01-17 16:54:12 -08:00
Daniel Micay
9fb49088b3
make is_disjoint O(n+m) instead of O(n*log(m))
2013-01-17 16:54:12 -08:00
Daniel Micay
8935771377
cleanup
2013-01-17 16:54:12 -08:00
Daniel Micay
4b567dd067
add TreeSetIterator
2013-01-17 16:54:12 -08:00
Daniel Micay
2b17e2fc18
docstring/comment fixes
2013-01-17 16:54:11 -08:00
Daniel Micay
3df183e7ab
fix bug in union implementation (missing return)
2013-01-17 16:54:11 -08:00
Daniel Micay
a73f4b1baa
implement symmetric_difference
2013-01-17 16:54:11 -08:00
Daniel Micay
d44084e100
implement set union
2013-01-17 16:54:11 -08:00
Daniel Micay
b8caba2fce
make TreeSet tests a bit more paranoid
2013-01-17 16:54:11 -08:00
Daniel Micay
1aaeda1e1e
add scaffolding for symmetric_difference/union
2013-01-17 16:54:11 -08:00
Daniel Micay
90b111f4bf
range search would be nice
2013-01-17 16:54:11 -08:00
Daniel Micay
670748e383
implement set difference
2013-01-17 16:54:11 -08:00
Daniel Micay
3b3ecc9ffc
fix API of union
2013-01-17 16:54:11 -08:00
Daniel Micay
dc27759bd1
remove 'TODO' from the list of future improvements
2013-01-17 16:54:11 -08:00
Daniel Micay
d001171435
rm extra newline
2013-01-17 16:54:11 -08:00
Daniel Micay
cae273abc0
clean up equality code a bit
2013-01-17 16:54:11 -08:00
Daniel Micay
1e5c553b7c
make Eq implementation O(n)
2013-01-17 16:54:11 -08:00
Daniel Micay
9cc9a7582c
add a lazy forward iterator to TreeMap
2013-01-17 16:54:11 -08:00
Daniel Micay
7f754764d6
replace treemap with a balanced tree
2013-01-17 16:54:11 -08:00
Patrick Walton
f405e41d7a
librustc: Implement write guards for borrowing @mut
to &
or &mut
. r=nmatsakis
2013-01-17 11:50:20 -08:00
Chris Peterson
ed17ce1dda
Implement Ord trait for Timespec
2013-01-16 23:37:21 -08:00
Daniel Micay
46880337f4
clean up tempfile module and rm FIXME
...
This removes the FIXME suggesting that mkdtemp should rely on the
default umask, because that would make it unusable for making a secure
work area in a world writable directory (have to assume that other users
have created files, directories, hard links, etc. in your directory).
The POSIX mkdtemp function creates a directory with 700 permissions to
avoid this problem.
2013-01-16 06:19:41 -05:00
Nick Desaulniers
bb7d7204e2
Swap return value order in pipes::oneshot Issue #4496
2013-01-15 17:18:00 -08:00
Brian Anderson
f1d0478002
Add cfg attrs to handle auto_encode transition
2013-01-14 13:17:20 -08:00
Brian Anderson
fc582bcfce
Merge remote-tracking branch 'mneumann/f-serialize'
2013-01-14 12:56:31 -08:00
Ashok Gautham
e69d491aea
Tidied up long lines
2013-01-14 10:01:09 +05:30