Marvin Löbel
bb9c3ed876
Added some generic number functions to core::num
...
Also fixes previous commit not compiling due to not finding Option.
2013-02-03 15:37:24 -08:00
Marvin Löbel
05d83017ec
Added char::from_digit(), char::is_digit_radix() and an argument check to char::to_digit().
2013-02-03 15:37:24 -08:00
Marvin Löbel
d13b23f37e
Added ToStrRadix and FromStrRadix traits
2013-02-03 15:37:24 -08:00
Marvin Löbel
96f0512a45
Added Round trait to core
2013-02-03 15:37:23 -08:00
Marvin Löbel
40f0b45f8e
Moved all numeric modules in core into own directory
...
Reason: Better grouping of related modules, future-proving for a more extensive math library.
2013-02-03 15:37:23 -08:00
Brian Anderson
4f6516969e
rt: Remove ports
2013-02-01 21:22:49 -08:00
Brian Anderson
542bf20414
core: Remove oldcomm
2013-02-01 21:22:49 -08:00
Nick Desaulniers
7868b6bf55
Remove fail keyword from lexer & parser and clean up remaining calls to
...
fail
Fix merge conflicts - Issue 4524
2013-02-01 00:15:42 -08:00
Nick Desaulniers
6fb4239bb3
Replace most invocations of fail keyword with die! macro
2013-01-31 22:25:12 -08:00
Nick Desaulniers
aee7929469
Replace most invocations of fail keyword with die! macro
2013-01-31 20:12:49 -08:00
Tim Chevalier
a9587b8fcd
core: Remove transitional code
2013-01-31 19:35:57 -08:00
Tim Chevalier
845b06542e
messing around with pipes and stages
2013-01-31 19:35:56 -08:00
Tim Chevalier
e0281d991c
core: Stamp out XXXes (comments only)
2013-01-31 19:34:46 -08:00
Brian Anderson
5aacf791e8
Merge pull request #4706 from sanxiyn/cleanup-fixme
...
Cleanup FIXMEs (#3488 )
2013-01-31 17:00:27 -08:00
Brian Anderson
c95c7c87b1
Merge pull request #4702 from aydinkim/patch-1
...
Delete unnecessary logs
2013-01-31 16:57:30 -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
Seo Sanghyeon
7b268e8316
Cleanup FIXMEs ( #3488 )
2013-01-31 19:23:18 +09:00
Aydin Kim
6102d2abf2
Delete unnecessary logs
2013-01-31 15:47:44 +09: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
77f2aac389
Merge pull request #4687 from alexcrichton/hashmap-speedup
...
Use task local random when initializing LinearMap
2013-01-30 14:48:49 -08:00
Cody Schroeder
b505504dc4
Add test for float::round
2013-01-30 01:28:04 -08:00
Alex Crichton
c75e59ac0f
Use task local random when initializing maps
2013-01-30 02:49:58 -05:00
Patrick Walton
28ed9dc09e
librustc: Long lines. rs=burning
2013-01-29 22:40:13 -08:00
Patrick Walton
0c1d9befb3
librustc: Speed up byte copy operations. r=nmatsakis
2013-01-29 22:15:06 -08:00
Patrick Walton
1b613ff9fc
librustc: Strdup unique strings instead of copying in byte by byte. Shaves 2MB off librustc at -O0.
2013-01-29 22:14:08 -08:00
Tim Chevalier
4b8dfad5cd
core tests: Add use vec; directive inside core::hashmap tests
...
This is probably to work around a bug.
2013-01-29 20:43:44 -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
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
Patrick Walton
d0391c5b09
libcore: De-export libcore. rs=deexporting
2013-01-29 11:48:46 -08:00
Tim Chevalier
1b021d5868
Long line
2013-01-29 11:44:46 -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
Alex Crichton
810eeef444
Fix the len() method on LinearMap during popping
2013-01-29 11:16:39 -05:00
Tim Chevalier
c5461e46ae
core: Allow legacy records in in a few modules
...
Because of macros, #[allow(structural_records]] in
extfmt, gc, os, pipes, and run. Will need a snapshot.
2013-01-28 19:41:56 -08:00
Brian Anderson
a72aeef9f7
Revert readline optimization and add test
2013-01-28 19:32:02 -08:00
Michael Neumann
d38939c7e8
Slightly optimize read_line()
...
No need to allocate an additional vector. Instead directly push into the
string.
2013-01-28 14:40:11 -08:00
Michael Neumann
02de11c1e7
Fix example code
2013-01-28 14:40:11 -08:00
Daniel Micay
8eaf0737b7
get rid of LinearMap's find_copy method
2013-01-28 16:06:09 -05:00
Brian Anderson
83ca034d2e
Merge remote-tracking branch 'brson/nocommupstream2'
2013-01-26 14:57:58 -08:00
Tim Chevalier
0743cec023
core: Remove structural records in library tests
2013-01-26 11:35:17 -08: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
Tim Chevalier
85a34c2898
Merge pull request #4625 from thestinger/container
...
more little container improvements
2013-01-25 11:57:51 -08:00
Tim Chevalier
2d33e308ac
core: Mop up Windows breakage
2013-01-24 20:39:09 -08:00
Daniel Micay
e4337a9def
remove remaining is_not_empty functions/methods
2013-01-24 23:24:57 -05:00
Daniel Micay
ec3f6e1932
implement Mutable trait for vec
2013-01-24 23:10:14 -05:00
Daniel Micay
d95c9cbe38
replace ConstVector trait with the Container trait
2013-01-24 23:02:44 -05:00
Tim Chevalier
b73d926a7e
Merge pull request #4623 from thestinger/map
...
clean up LinearMap implementation
2013-01-24 19:17:23 -08:00
Daniel Micay
5c14b91bad
clean up LinearMap implementation
2013-01-24 22:04:16 -05:00
Erick Tryzelaar
11fd2beef9
Convert dlist records into structs
2013-01-24 16:24:31 -08:00
Erick Tryzelaar
339618a7f9
convert io wrapper records into structs
2013-01-24 16:24:31 -08:00
Erick Tryzelaar
9b17e7a777
Fix another typo
2013-01-24 16:24:31 -08:00
Erick Tryzelaar
5085eb3c28
Convert pipes::Buffer into a struct
2013-01-24 16:24:31 -08:00
Erick Tryzelaar
feab095d65
Convert core::pipes::{Packet,Chan_,Port_} into structs
2013-01-24 16:24:31 -08:00
Erick Tryzelaar
90734a0d33
Convert extfmt::rt::Conv into a struct
2013-01-24 16:24:31 -08:00
Erick Tryzelaar
79a9b23f4a
Fix a typo
2013-01-24 16:24:31 -08:00
Erick Tryzelaar
c15facb5c0
Remove "unsafe" from run::start_program
2013-01-24 16:24:30 -08:00
Erick Tryzelaar
e22d2bc4bc
core: convert io::Res over to the Drop trait
2013-01-24 16:24:30 -08:00
Erick Tryzelaar
e4d4a1499b
convert most of libcore records into structs
2013-01-24 16:24:30 -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
163b97b7bb
librustc: Make C functions unsafe
2013-01-24 13:52:21 -08:00
Daniel Micay
dbfe21edda
document LinearMap::new
2013-01-24 13:36:55 -05:00
Daniel Micay
acde90dc1c
remove old LinearMap constructor
2013-01-24 13:36:04 -05:00
Graydon Hoare
07d0af151a
core: fix windows breakage from 982cf90
, r=burningtree.
2013-01-23 21:57:05 -08: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
Tim Chevalier
982cf90dc6
Add a T_SIGNED type to uint template and eliminate step_down variant
...
Handle negative steps properly in range_step, fix order of arguments
in tests, and such.
2013-01-23 18:57:57 -08:00
Huon Wilson
1a6e1e2801
libcore: Correct behaviour of range_step for uint, tests for range* functions.
...
Splits the range_step function into the two directions (up, low -> high,
and down, high -> low) for the uint types, since there is no way to have
`step < 0` for a backwards range.
2013-01-23 18:56:41 -08:00
Huon Wilson
83e3c82d63
libcore: Add range_step and range_rev functions.
...
Closes #1817
2013-01-23 18:56:41 -08:00
Brian Anderson
bc0c5bb447
core: Stop using oldcomm
2013-01-23 17:35:35 -08:00
Brian Anderson
cc9ab2c033
Remove old comm-based weak task interface
2013-01-23 17:35:34 -08: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
Brian Anderson
fb9299346a
core: Convert getenv/setenv to use a mutex
...
This much simpler implementation uses a global mutex
and eliminates the kernel environment channel.
2013-01-23 17:35:34 -08:00
Brian Anderson
8852279a9e
core: Add new weak task API
2013-01-23 17:35:31 -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
Tim Chevalier
10e8ae852d
Merge pull request #4597 from Dretch/atvec-constructors
...
Oops - add the missing pubs!
2013-01-23 14:37:47 -08:00
gareth
ba2a3e8234
Oops - add the missing pubs!
2013-01-23 22:30:56 +00:00
Daniel Micay
591eefd740
improve hashmap/treemap documentation
2013-01-23 16:47:27 -05:00
Daniel Micay
988ce7180d
rm unnecessary usage of 'unsafe' from hashmap
2013-01-23 16:39:09 -05:00
Daniel Micay
8bf9bae303
remove cautionary wording in the hashmap docstring
...
it's pretty solid, at least relative to most of the other modules
2013-01-23 16:29:38 -05:00
Patrick Walton
6dbfb5da0b
libcore: Use LLVM intrinsics for floor; add a new Perlin noise benchmark. r=brson
2013-01-23 11:37:32 -08:00
Daniel Micay
dbeef1d657
remove the LinearMap get_copy method
...
This isn't simpler (or faster) than just doing the copy in the caller,
and it doesn't work for types that can be cloned but not copied.
2013-01-23 14:25:06 -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
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
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
Daniel Micay
8cff5c22c3
migrate task/spawn.rs to LinearSet
2013-01-22 21:28:28 -05:00
Daniel Micay
7de5e6c487
migrate gc.rs to LinearSet
2013-01-22 21:28:28 -05:00
gareth
9b27ec8684
Add more constructors for managed vectors (as proposed in issue #4553 )
2013-01-22 22:52:20 +00: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
Tim Chevalier
143039ca43
docs: Fix typo
2013-01-21 19:50:38 -08:00
William Ting
60184d12b6
Update documentation with examples for various int, vec methods.
...
add int::range(), remainder() examples
add vec::foldl(), foldr() examples
tweak
2013-01-21 19:50:38 -08:00
William Ting
04d38f38e7
minor int-template.rs cleanup
2013-01-21 11:15:11 -06:00
Daniel Micay
1f85c711af
fix long lines
2013-01-20 17:07:57 -05:00
Tim Chevalier
b86c90b73a
Merge pull request #4554 from thestinger/set
...
add a Set trait
2013-01-20 13:45:42 -08:00
Daniel Micay
5320e132d1
add a LinearSet type (implementing the Set trait)
2013-01-20 15:12:52 -05:00
Daniel Micay
13d07ad0a6
add a Set trait and implement it for TreeSet
2013-01-20 14:58:19 -05:00
Simon Sapin
9788c41ce7
repr: represent char values as char literals rather than integers.
2013-01-20 12:03:02 +01:00
Tim Chevalier
b72ed5572f
core: Allow set_buffer_ to be referred to as set-buffer
...
After a snapshot, we can take out the set_buffer_ version (pipes
syntax exts use it).
As per #4421
2013-01-18 15:28:34 -08:00
Chris Peterson
a8ff9f2ef9
Rename copy_overlapping_memory() to copy_memory()
2013-01-18 14:38:46 -08:00
Tim Chevalier
9c1476e7a4
Comments: turn XXXes into FIXMEs
2013-01-18 14:21:31 -08:00
Brian Anderson
6b6acde972
Add a license check to tidy. #4018
2013-01-17 23:28:42 -08:00
Brian Anderson
1bf8e57943
Add finally
method for deferred execution
2013-01-17 19:24:52 -08:00
Brian Anderson
db1abbec4c
core: Add private global data interface. #3915
2013-01-17 19:24:50 -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
Brian Anderson
ac435af73a
Add at_exit function #4450
2013-01-15 18:00:19 -08:00
Brian Anderson
090b247056
Spawn new tasks onto the primary scheduler by default. #3760
2013-01-15 18:00:19 -08:00
Graydon Hoare
84825ee310
librustc: Make the default sigil for block lambdas &
instead of @
.
2013-01-15 17:57:45 -08:00
Nick Desaulniers
bb7d7204e2
Swap return value order in pipes::oneshot Issue #4496
2013-01-15 17:18:00 -08:00
Brian Anderson
0ca369e9dc
Merge pull request #4485 from sanxiyn/use-truncate
...
Use vec::truncate for vec::retain
2013-01-14 14:11:26 -08:00
Brian Anderson
e699058511
Merge pull request #4484 from sanxiyn/test-retain
...
Add a test for vec::retain
2013-01-14 14:09:17 -08:00
Brian Anderson
0e8490757f
Merge pull request #4477 from jld/char-repr
...
Reflect on char as u32, not uint (which may be u64).
2013-01-14 13:39:29 -08:00
Daniel Micay
d0751b6535
spelling fixes for iter module docstrings
2013-01-14 09:46:32 -05:00
Seo Sanghyeon
e368b16f82
Use vec::truncate for vec::retain
2013-01-14 19:45:08 +09:00
Seo Sanghyeon
23b130441a
Add a test for vec::retain
2013-01-14 17:38:15 +09:00
Jed Davis
0e1985eda6
Reflect on char as u32, not uint (which may be u64).
...
Fixes mozilla/rust#4473 .
2013-01-13 19:08:30 -08:00
kyeongwoon
987f824f23
Support ARM and Android
...
Conflicts:
src/libcore/os.rs
src/librustc/back/link.rs
src/librustc/driver/driver.rs
src/librustc/metadata/loader.rs
src/librustc/middle/trans/base.rs
2013-01-13 16:43:39 -08:00
Tim Chevalier
62d1db1d6c
Long lines
2013-01-13 16:34:54 -08:00
Tim Chevalier
07c39b1436
Merge pull request #4474 from tychosci/readlink_safe
...
core: Use libc::readlink function properly
2013-01-13 15:10:33 -08:00
Tim Chevalier
26334b64a2
Merge pull request #4411 from wting/4203_rename_memcpy
...
Rename memcpy, memmove, memset
2013-01-13 14:58:24 -08:00
Jed Davis
1b01629f18
Make vectors (& old ports) of zero-size types allocate one byte each.
2013-01-13 14:37:59 -08:00
Tycho Sci
6441d619ba
core: Use libc::readlink function properly
...
The specification of readlink() says it's not guaranteed that the
returned contents of the symbolic link is null-terminated.
2013-01-14 07:33:47 +09:00
Peter Williams
d5dc66ad31
core: Align cmp::le() with the other implementations
...
Also add comments reminding that IEEE 754 requires unusual semantics for
comparison operators as applied to NaNs (x != x, if x = NaN), in case someone
in the future wants to get clever.
2013-01-13 14:32:34 -08:00
Tim Chevalier
7eae397e58
Merge pull request #4465 from thestinger/option
...
improvements to option module
2013-01-13 14:29:05 -08:00
Daniel Micay
ac85bf356f
add Option methods for in-place mutation
2013-01-13 11:09:09 -05:00
gifnksm
62f2749775
Inlining methods/functions in core.
...
Also inlining some functions which take functions as arguments.
2013-01-14 00:13:44 +09:00
Daniel Micay
3c6da7761b
avoid unwrap in Option::map_consume implementation
2013-01-13 01:38:20 -05:00
Daniel Micay
65a0125f7f
add Option map_consume_default method
2013-01-13 01:37:58 -05:00
Daniel Micay
a33966b2f2
add Option methods for swap_unwrap and map_consume
2013-01-13 00:48:30 -05:00
Tim Chevalier
0bc730f9b0
Merge pull request #4443 from wting/4386_add_privs
...
Adds priv qualifiers where they have been commented out before implementation.
2013-01-11 20:11:57 -08:00
Tim Chevalier
847d30db66
Merge pull request #4445 from apasel422/notop
...
Allow logical negation operator (!) to be overloaded
2013-01-11 20:10:51 -08:00
Brian Anderson
f99d6cab43
Long lines
2013-01-11 17:59:35 -08:00
Brian Anderson
1b1700f44b
Add core::private::run_in_bare_thread
...
This begins executing Rust code in a fresh context with no runtime environment
2013-01-11 14:53:28 -08:00
Andrew Paseltiner
0de7aa5506
allow logical negation operator (!) to be overloaded
2013-01-11 14:31:44 -05:00
William Ting
9fd970ad13
Adds priv qualifiers where they have been commented out before implementation.
...
Updates #4386 .
2013-01-11 02:30:10 -06:00
Patrick Walton
ad2fc50ca1
libcore: Fix core test more. rs=broken
2013-01-10 23:08:17 -08:00
Patrick Walton
c6fe93d9b5
libcore: Fix core test. rs=broken
2013-01-10 22:36:54 -08:00
Patrick Walton
83675895af
libcore: Fix windows bustage. rs=bustage
2013-01-10 21:58:30 -08:00
Patrick Walton
b71381dcc9
libcore: Fix linux/windows bustage. rs=fire
2013-01-10 21:49:31 -08:00