Brian Anderson
1eae49748d
Ignore a should_fail test on windows
2012-07-05 23:26:41 -07:00
Ben Striegel
d162fa26ba
A new times
method on numeric types
...
This method is intended to elegantly subsume two common iteration functions.
The first is `iter::range`, which is used identically to the method introduced
in this commit, but currently works only on uints. The second is a common case
of `{int, i8, uint, etc.}::range`, in the case where the inductive variable is
ignored. Compare the usage of the three:
```
for iter::range(100u) {
// do whatever
}
for int::range(0, 100) |_i| {
// do whatever
}
for 100.times {
// do whatever
}
```
I feel that the latter reads much more nicely than the first two approaches,
and unlike the first two the new method allows the user to ignore the specific
type of the number (ineed, if we're throwing away the inductive variable, who
cares what type it is?). A minor benefit is that this new method will be
somewhat familiar to users of Ruby, from which we borrow the name "times".
2012-07-05 19:44:20 -07:00
Ben Blum
2ee779c839
Add test case in task.rs for #2782
2012-07-05 21:01:18 -04:00
Ben Blum
7b3add0632
make disallow_kill an int for nested unkillables ( closes #2782 )
2012-07-05 19:56:09 -04:00
Tim Chevalier
50d2e7e07e
Mostly change TODOs to FIXMEs and annotate them
...
But, one change in io to implement a TODO suggestion (using a
const u8)
2012-07-05 15:06:33 -07:00
Brian Anderson
8f92de3ce5
core: Actually build to_bytes
2012-07-05 14:40:45 -07:00
Brian Anderson
c199090130
core: Export to_bytes
2012-07-05 14:38:59 -07:00
Eric Holk
d93f3c5d83
Arc requires send trait (issue #2788 )
2012-07-05 10:25:38 -07:00
Eric Holk
5bfb5cad3a
Remove create_lock in favor of lock_and_signal() (issue #2780 )
2012-07-05 10:11:25 -07:00
Gareth Daniel Smith
be0141666d
convert doc-attributes to doc-comments using ./src/etc/sugarise-doc-comments.py (and manually tweaking) - for issue #2498
2012-07-04 19:18:13 -07:00
Ben Striegel
f2e2a14f36
Remove empty argument lists from do expressions
2012-07-04 17:21:29 -07:00
Erick Tryzelaar
2f9c0114fa
Add a to_bytes iface and a handful of impls
2012-07-03 21:30:09 -07:00
Ben Blum
aa909dc60a
oops, fix option.expect() and use it in libstd/map.rs
2012-07-03 21:03:51 -04:00
Brian Anderson
41bca84dd9
core: Convert iter::repeat to the for protocol
2012-07-03 17:31:31 -07:00
Ben Blum
e000d1db0a
add option::expect and mark option methods as pure
2012-07-03 20:29:07 -04:00
Graydon Hoare
be2c92078b
Change crust -> extern.
2012-07-03 16:49:46 -07:00
Graydon Hoare
debb7e4641
Switch 'native' to 'extern' (or 'foreign' in some descriptions)
2012-07-03 16:11:00 -07:00
Patrick Walton
e1ee198216
core: Import future::extensions
2012-07-03 15:56:27 -07:00
Ben Blum
70070b8bbc
task.rs: minor doc/comment changes
2012-07-03 18:39:58 -04:00
Patrick Walton
1c2843c8ad
core: Eliminate some overloading of the name "future" in future.rs
2012-07-03 11:24:01 -07:00
Erick Tryzelaar
39492782fa
Export dvec::from_elt.
2012-07-03 09:14:46 -07:00
Brian Anderson
2ea8922b8a
Merge remote-tracking branch 'brson/uv'
2012-07-02 21:39:08 -07:00
Patrick Walton
f093d374ed
rustc: Implement a new resolve pass behind a compile flag
2012-07-02 18:30:12 -07:00
Brian Anderson
47f43da376
Merge branch 'doc-comments'
2012-07-02 15:31:33 -07:00
Brian Anderson
569467eb0d
Merge remote-tracking branch 'Dretch/prettydocs'
...
Conflicts:
src/compiletest/errors.rs
src/libsyntax/parse/attr.rs
src/libsyntax/parse/comments.rs
src/test/compile-fail/ambig_impl_unify.rs
src/test/compile-fail/assign-super.rs
src/test/compile-fail/bad-for-loop.rs
src/test/compile-fail/bad-var-env-capture-in-block-arg.rs
src/test/compile-fail/block-arg-as-stmt-with-value.rs
src/test/compile-fail/borrowck-assign-comp-idx.rs
src/test/compile-fail/borrowck-lend-flow.rs
src/test/compile-fail/borrowck-loan-blocks-move-cc.rs
src/test/compile-fail/borrowck-loan-blocks-mut-uniq.rs
src/test/compile-fail/borrowck-loan-rcvr.rs
src/test/compile-fail/borrowck-loan-vec-content.rs
src/test/compile-fail/borrowck-mut-vec-as-imm-slice-bad.rs
src/test/compile-fail/cap-clause-with-stack-closure.rs
src/test/compile-fail/do1.rs
src/test/compile-fail/do2.rs
src/test/compile-fail/empty-vec-trailing-comma.rs
src/test/compile-fail/evec-subtyping.rs
src/test/compile-fail/issue-1896.rs
src/test/compile-fail/issue-2149.rs
src/test/compile-fail/issue-2150.rs
src/test/compile-fail/issue-2487-b.rs
src/test/compile-fail/kindck-implicit-close-over-mut-var.rs
src/test/compile-fail/liveness-issue-2163.rs
src/test/compile-fail/liveness-use-in-index-lvalue.rs
src/test/compile-fail/no-reuse-move-arc.rs
src/test/compile-fail/no-send-res-ports.rs
src/test/compile-fail/non-const.rs
src/test/compile-fail/pure-higher-order.rs
src/test/compile-fail/pure-loop-body.rs
src/test/compile-fail/regions-addr-of-upvar-self.rs
src/test/compile-fail/regions-escape-loop-via-vec.rs
src/test/compile-fail/regions-scoping.rs
src/test/compile-fail/seq-args.rs
src/test/compile-fail/tstate-unsat-in-called-fn-expr.rs
src/test/compile-fail/tstate-unsat-in-fn-expr.rs
src/test/compile-fail/vec-add.rs
src/test/compile-fail/vec-concat-bug.rs
src/test/compile-fail/vector-no-ann.rs
2012-07-02 15:23:41 -07:00
Ben Blum
eb28b768af
dlist should_fail tests ignore(cfg(windows))
2012-07-02 18:08:09 -04:00
Brian Anderson
6d411342c6
Merge remote-tracking branch 'brson/uv'
...
Conflicts:
src/libstd/net_ip.rs
src/libstd/net_tcp.rs
2012-07-02 14:03:38 -07:00
Ben Blum
3ced5b0da2
add dlist.rs should_fail tests
2012-07-02 16:47:55 -04:00
Ben Blum
3777a14f08
Add doubly-linked list to libcore (to be used in task.rs).
2012-07-02 16:03:38 -04:00
Brian Anderson
d1fc2b5995
Convert to new closure syntax
2012-07-01 19:19:32 -07:00
Brian Anderson
a3382b6f26
Eliminate usages of old sugared call syntax
2012-06-30 16:01:49 -07:00
Gareth Daniel Smith
0b653ab953
initial draft of fix for issue #2498 :
...
1. make /// ... and //! ... and /** ... */ and /*! ... */ into sugar for #[doc = ...] attributes.
2. add a script in etc/ to help converting doc-attributes to doc-comments
3. add some functions to core::str to help with (1)
2012-06-30 11:54:54 +01:00
Michael Sullivan
98e161f00e
Switch the compiler over to using ~[] notation instead of []/~. Closes #2759 .
2012-06-29 17:41:45 -07:00
Jeff Olson
708b5d986e
core: str::as_slice is unneeded, yay! fixes std::net::tcp socket_buf test
...
i mistook an "unconstrained type" error, due to type-inference messup
because i didnt have return vals in some closure wired-up right, for being
due to not having a str as a str/& (a str will actually auto-coerce to a
str/&, so str::as_slice was erroneously added. my bad).
2012-06-29 15:41:55 -07:00
Jeff Olson
099d080233
core: adding str::as_slice .. most likely broken
2012-06-29 15:41:55 -07:00
Jeff Olson
5ec68ac482
core: export vec::unshift
2012-06-29 15:41:55 -07:00
Michael Sullivan
7aa43b2599
Make fmt use a bitmask instead of a vector of flags. Closes #1993 .
2012-06-28 23:36:00 -07:00
Ben Blum
6fc730baf6
Cleanup failure handling around rust_new_task_in_sched - closes #2668
2012-06-28 19:02:48 -04:00
Ben Blum
54713afa20
add TLS failure test case in task.rs
2012-06-28 17:45:48 -04:00
Eric Holk
59221e9ac8
replace more vector + (issue #2719 )
2012-06-28 13:52:23 -07:00
Ben Blum
af2d01e36b
Fix sys::refcount and remove dbg::refcount
2012-06-28 14:40:31 -04:00
Eric Holk
ae06546bbf
Replace more vector + (issue #2719 )
2012-06-27 23:09:51 -07:00
Eric Holk
0b84437b68
Replace more vector additions (issue #2719 )
2012-06-27 22:49:05 -07:00
Brian Anderson
6f57c61ed0
Tidy fixes
2012-06-27 22:03:12 -07:00
Ben Blum
1ff6f9b876
Add task-local storage in libcore.
2012-06-28 00:10:09 -04:00
Ben Blum
e56ba156e2
Add position() to iter/iter-trait
2012-06-28 00:02:16 -04:00
Eric Holk
0c42a3ffee
vec::append reuses its left hand side when possible. (issue #2719 )
2012-06-27 16:19:49 -07:00
Eric Holk
c3b98cabe1
Removed pretty much all the vector+ from core (issue #2719 )
2012-06-27 15:22:06 -07:00
Eric Holk
133fdc1148
Remove unnecessary bounds checks in vec::push_all (issue #2719 )
...
Don't needlessly drop closures (issue #2603 )
2012-06-27 11:32:22 -07:00
Eric Holk
404afcbb41
Mark exclusive arc-related functions as unsafe. Fixes #2727 .
2012-06-27 10:24:51 -07:00
Graydon Hoare
697f1e38d6
Change 'native' and 'crust' to 'extern'.
...
This comes with a terminology change. All linkage-symbols are 'extern'
now, including rust syms in other crates. Some extern ABIs are
merely "foreign". The term "native" is retired, not clear/useful.
What was "crust" is now "extern" applied to a _definition_. This
is a bit of an overloading, but should be unambiguous: it means
that the definition should be made available to some non-rust ABI.
2012-06-26 16:18:37 -07:00
Eric Holk
a08281616f
More perf tweaks (issue #2719 )
2012-06-26 14:08:16 -07:00
Patrick Walton
6413421c8c
core: make_a_sandwitch -> make_a_sandwich
2012-06-26 13:55:33 -07:00
Eric Holk
b9d3ad0736
Getting rid of lots more vector +=. (issue #2719 )
2012-06-26 00:39:18 -07:00
Michael Sullivan
329eca6044
Make vectors uglier ([]/~). Sorry. Should be temporary. Closes #2725 .
2012-06-25 20:00:46 -07:00
Eric Holk
b837f37d40
vec::slice is faster now (Issue #2719 )
2012-06-25 17:08:06 -07:00
Eric Holk
b19c98ea9a
Some perf fixes, although vec::slice is still too slow (Issue #2719 )
2012-06-25 16:38:12 -07:00
Brian Anderson
7e6cbf7431
Remove redundant 'extension' mods from numeric mods
2012-06-25 14:25:48 -07:00
Ben Striegel
43a48ca5bb
Automatically export methods on core numeric types
...
Each numeric type now contains an extensions module that is automatically
exported. At the moment each extensions module contains only the impl for the
`num::num` iface. Other impls soon to follow (hopefully).
2012-06-25 14:25:48 -07:00
Tim Chevalier
da470ff5b8
Merge
2012-06-25 13:29:41 -07:00
Brian Anderson
fad307d7b4
core: Convert declarations to not use the trailing 'unsafe' notation
2012-06-25 12:48:39 -07:00
Eric Holk
07e1d1c6b6
Improved graph500 performance (Issue #2719 )
2012-06-25 11:15:45 -07:00
Brian Anderson
2f060eb880
core: Name is_failure to is_err, is_success to is_ok
2012-06-22 18:26:25 -07:00
Brian Anderson
58983b2d92
core: Export result extensions from the top level
2012-06-22 17:33:53 -07:00
Brian Anderson
0cf730ed2a
core: Split up result extensions by kind bounds
2012-06-22 17:32:57 -07:00
Eric Holk
5cf99e02b5
Adding unshift again.
2012-06-22 16:31:57 -07:00
Eric Holk
26c11f7b50
Use must_have_lock instead of private functions. (Issue #2700 )
...
I hereby declare that messages sent from the same source arrive in order (Issue #2605 )
Removing FIXME, owned is the correct type here. (Issue #2704 )
Remove outdated FIXME (Issue #2703 )
Updating test for spawning native functions (Issue #2602 )
Removing bogus FIXME (Issue #2599 )
2012-06-22 15:14:42 -07:00
Tim Chevalier
25aa360595
[NEEDS SNAPSHOT] Port remainder of resources to classes in libcore
2012-06-21 22:20:09 -07:00
Tim Chevalier
fee78d296c
Port resources to classes in libcore
2012-06-21 21:30:16 -07:00
Graydon Hoare
312faf31df
Tag all remaining FIXMEs with bugs. Install rule in tidy script to enforce this.
2012-06-21 16:44:10 -07:00
Eric Holk
28ab0e8c03
Fixing illegal moves.
2012-06-21 16:11:11 -07:00
Eric Holk
dc3862bf58
This was unsafe, and will probably leak.
2012-06-21 16:11:11 -07:00
Eric Holk
3b9848b869
Remove some warnings and make tests pass.
2012-06-21 16:11:11 -07:00
Eric Holk
e4c291530e
Basic functionality for new ports and chans
...
The first benchmark shows about twice the throughput of the old system.
2012-06-21 16:11:11 -07:00
Eric Holk
9bdb2c9e48
Library vecs are fast now.
2012-06-21 16:11:11 -07:00
Eric Holk
0e5cfd9f33
Move vector addition out of trans and into libcore.
2012-06-21 16:11:11 -07:00
Brian Anderson
453e29cc39
core: Remove resolved FIXME around port destruction
2012-06-21 13:41:59 -07:00
Tim Chevalier
1b642bf02f
Change core::comm to use classes instead of resources
...
Ports now are represented internally as classes.
2012-06-20 20:12:14 -07:00
Tim Chevalier
0017116520
Don't shadow a class name with a local
...
The fix in 208621 means you now can't shadow a class name with a local,
which is consistent with other behavior. But stackwalk was doing that.
Fixed it.
2012-06-20 20:12:14 -07:00
Tim Chevalier
1b4dcbecac
Comments only: typos
2012-06-20 20:12:14 -07:00
Brian Anderson
4dcf84e4f4
Remove bind. Issue #2189
2012-06-20 17:27:28 -07:00
Eric Holk
514e8ded2f
Temporarily ignoring tests that can go into infinite loops.
2012-06-19 18:03:28 -07:00
Eric Holk
2a128fa205
Reference fixes.
2012-06-19 10:31:12 -07:00
Eric Holk
be664ddd29
Moved arc to libcore and added an arc that allows shared mutable state through mutual exclusion.
2012-06-19 10:31:12 -07:00
Eric Holk
dc718d97a6
Adding a lock/condition variable to libcore.
2012-06-19 10:31:12 -07:00
Brian Anderson
ff536f3fa5
core: Don't require copyable options where possible. Closes #2636
2012-06-18 12:57:30 -07:00
Tim Chevalier
3e2006a570
Revert "Adding a lock/condition variable to libcore."
...
This reverts commit e394ebda37
.
2012-06-16 15:34:15 -07:00
Tim Chevalier
0276a3376b
Revert "Moved arc to libstd and added an arc that allows shared mutable state through mutual exclusion."
...
This reverts commit 015527b0ce
.
2012-06-16 15:21:08 -07:00
Tim Chevalier
69447e9002
Revert "Reference and whitespace fixes."
...
This reverts commit 52f1904ddd
.
2012-06-16 15:17:10 -07:00
Eric Holk
52f1904ddd
Reference and whitespace fixes.
2012-06-15 22:14:02 -04:00
Eric Holk
21d56f2c68
Fixed a bug in extfmt where it couldn't parse unicode in format strings.
2012-06-15 22:01:07 -04:00
Eric Holk
015527b0ce
Moved arc to libstd and added an arc that allows shared mutable state through mutual exclusion.
2012-06-15 22:00:58 -04:00
Eric Holk
e394ebda37
Adding a lock/condition variable to libcore.
2012-06-15 22:00:24 -04:00
Niko Matsakis
e6c613ffa5
remove irrelevant fixme ( #2607 )
2012-06-15 06:24:52 -07:00
Tim Chevalier
a214e3abd2
Comments only: annotate FIXME in core::str
2012-06-14 19:32:41 -07:00
Tim Chevalier
d0e1591a6a
Comments only: annotate FIXMEs in core::run
2012-06-14 19:32:41 -07:00
Tim Chevalier
70dde68cfb
Annotate one FIXME and remove another
...
...since we probably won't have this kind of typestate.
2012-06-14 19:32:41 -07:00
Tim Chevalier
c96ae78c38
Comments only: annotate FIXMEs in core::os
2012-06-14 19:32:41 -07:00
Tim Chevalier
39d9c30a15
Remove code from parser that was awaiting snapshot
...
Remove old parser functions as well as support for old-style capture
clauses. Remove remaining old-style capture clauses.
2012-06-14 19:09:02 -07:00
Tim Chevalier
7ee7ba5955
Remove workaround
2012-06-14 18:21:17 -07:00
Tim Chevalier
7441a90fd9
Comments only: annotate FIXMEs
2012-06-14 18:21:17 -07:00
Tim Chevalier
9e9e280446
annotate FIXME in iter-trait
2012-06-14 17:57:22 -07:00
Tim Chevalier
8945255559
Comments only: Annotate FIXMEs in libcore
2012-06-14 17:56:41 -07:00
Tim Chevalier
ffc9fff720
In dvec, annotate a FIXME and uncomment append_iter
...
I uncommented append_iter and made it compile. I hope it wasn't
horribly flawed in some other way... but if so, there was no comment
explaining how.
2012-06-14 17:56:41 -07:00
Patrick Walton
e38eaed978
Add a Num typeclass
2012-06-14 10:55:49 -07:00
Erick Tryzelaar
48e877a435
Rewrite int/uint helper functions to use refs
...
This lets us pass them to generic functions.
2012-06-12 18:10:19 -07:00
Erick Tryzelaar
4335ce47f3
Convert most str and vec fns to slices
2012-06-12 18:10:18 -07:00
Brian Anderson
07bba397c5
core: More stack walking
2012-06-11 22:44:55 -07:00
Brian Anderson
8fea5260c2
core: Don't deadlock on io streams in run::program_output
...
We can't just read all of stdout before stderr or it will cause
deadlocks for children that want to write a lot to stderr
I could not come up with an obvious cross-platform way to easily
test this.
2012-06-08 23:00:59 -07:00
Brian Anderson
c91d5aa95c
Merge pull request #2560 from bstrie/num
...
Allow multiple `num` impls to be imported at once
2012-06-08 22:59:53 -07:00
Ben Striegel
d14d4155de
Allow multiple num
impls to be imported at once
...
If we import num::num, it gets reexported implicitly and causes collisions if
you try to import (for example) int::num and i8::num at the same time.
2012-06-09 01:36:26 -04:00
Patrick Walton
5a04069042
Merge pull request #2559 from mozilla/incoming
...
Incoming
2012-06-08 20:37:57 -07:00
Brian Anderson
45f2926144
core: Inline unsigned range function
2012-06-08 18:49:50 -07:00
Ben Striegel
89e424d373
Inline range
for all integral types
2012-06-08 21:18:41 -04:00
Patrick Walton
8ce0215f1b
core: "inlune" is not an attribute
2012-06-08 17:57:39 -07:00
Patrick Walton
fbd583bde2
core: Implement string equal natively to save a call into the shape code. Shaves a couple of seconds off rustc.
2012-06-08 17:38:12 -07:00
Brian Anderson
7a74545e97
Convert reinterpret_cast + forget to 'transmute'
2012-06-08 10:58:46 -07:00
Brian Anderson
f12adcbf93
core: Add unsafe::transmute
...
Like reinterpret_cast + forget
2012-06-08 10:58:46 -07:00
Brian Anderson
95b9d538b8
Use #[cfg(unix)] and #[cfg(windows)] everywhere
2012-06-07 22:28:00 -07:00
Brian Anderson
c058f1d992
core: Remove transitional code
2012-06-07 19:12:12 -07:00
Patrick Walton
7571ee85c4
Merge branch 'incoming'
2012-06-07 18:50:42 -07:00
Patrick Walton
e158ce8a9d
Add neg() to the num iface
2012-06-07 18:27:10 -07:00
Patrick Walton
02b7089e15
libcore: Add a num typeclass
2012-06-07 17:25:54 -07:00
Patrick Walton
3d7400f3ac
Add a Num typeclass
2012-06-07 16:08:38 -07:00
Niko Matsakis
3cbd1e221e
mark addr_or and friends pure
2012-06-07 07:18:29 -07:00
Brian Anderson
5f4837ad6a
core: Start on a stack walker
2012-06-06 23:39:56 -07:00
Brian Anderson
2c5a660c99
core: Add os::family. Returns either 'windows' or 'unix'
2012-06-06 23:39:09 -07:00
Niko Matsakis
3b4cfdeee2
Merge remote-tracking branch 'mozilla/incoming'
...
Conflicts:
src/rustc/middle/tstate/auxiliary.rs
2012-06-06 19:00:34 -07:00
Niko Matsakis
0d20717fab
add some purity annotations in dvec/vec, occasional accessor method
2012-06-06 18:37:07 -07:00
Niko Matsakis
b828df93f6
miscellaneous pure annotations and other small changes.
...
it seems that, to be truly useful, pure fns really need the
ability to modify their parameters. alternatively, we could
rewrite the functions that modify their arguments to take/return.
2012-06-06 18:36:54 -07:00
Niko Matsakis
83d290f461
add misc. pure modifiers in core
2012-06-06 18:36:29 -07:00
Niko Matsakis
bede54b14a
misc. copies in core/syntax to please borrowck
2012-06-06 18:36:15 -07:00
Brian Anderson
ef32ffd0b1
core: Remove swappable. Unused
2012-06-06 17:48:45 -07:00
Tim Chevalier
a6c92f0a17
Revert "Revert "Merge pull request #2516 from mozilla/incoming" due to failures"
...
This reverts commit 9fae95860de510f6874810cf43efb83f101246ef.
2012-06-06 15:08:24 -07:00
Patrick Walton
d64ff98311
Revert "core: Remove swappable. Unused" due to test failures
...
This reverts commit ec5cbb4f5e
.
2012-06-06 11:40:04 -07:00
Patrick Walton
055158d051
Revert "Merge pull request #2516 from mozilla/incoming" due to failures
...
This reverts commit adb717b5fa
, reversing
changes made to aabf84cdd8
.
2012-06-06 11:39:19 -07:00
Patrick Walton
d9cdddeb5f
stdlib: Introduce ord and eq interfaces. Make std::sort::quick_sort3 use them. i=#2348
2012-06-05 17:26:52 -07:00
Brian Anderson
ec5cbb4f5e
core: Remove swappable. Unused
2012-06-05 14:47:20 -07:00
Brian Anderson
78fe75a741
rt: Fix iaac_init using wrong type and not seeding correctly
...
This was a result of changing the vector representation to contain
a box header.
2012-06-05 00:21:19 -07:00
Michael Sullivan
6396e2c3c3
Make vecs implicitly copyable for all of our projects.
2012-06-04 19:53:30 -07:00
Eric Holk
1e8f501343
Machine types are different from int/uint, etc (Issue #2187 )
2012-06-04 19:16:47 -07:00
Graydon Hoare
5f904d278f
Shave off one more string append in a rare case.
2012-06-04 19:01:24 -07:00
Graydon Hoare
7803488a43
Implement stack-only variants of int/uint str conversion and output.
2012-06-04 18:06:59 -07:00
Brian Anderson
2d0e7cd272
core: Don't allow radix 1 in uint::to_str
2012-06-04 15:22:40 -07:00
Brian Anderson
6e0085210c
core: Make uint::to_str faster
2012-06-04 14:30:57 -07:00
Niko Matsakis
01b5777c8b
prohibit type parameters in native fns and other minor fixes
...
trans now can safely assert that it never sees a type param
2012-06-03 20:03:08 -07:00
Brian Anderson
8fbd5ac049
core: Add str::is_alphanumeric fn and method
2012-06-02 23:42:20 -07:00
Niko Matsakis
3f6e6532ac
make vec fns/methods take imm slices.
...
this also repairs the unsoundness in typing of unpack_slice,
which was silently converting a const ptr to an imm one.
2012-06-02 19:14:57 -07:00
Kevin Cantu
a7359f5b3b
(float) fix some rounding errors when showing as str
...
This seems to fix issue #1876 , and some of the superficial parts of
issue #1375 . The #fmt macro and the to_str functions will round,
rather than truncate, floats as strings.
Other issues remain, and I wrote more code here than intended, but the
following should pass now.
```
fn x() {
assert "3.1416" == #fmt["%.4f", 3.14159];
assert "3" == #fmt["%.0f", 3.14159];
assert "99" == #fmt["%.0f", 98.5];
assert "7.0000" == #fmt["%.4f", 6.999999999];
assert "3.141590000" == #fmt["%.9f", 3.14159];
}
```
2012-06-02 16:38:18 -07:00
Niko Matsakis
c5f2c1d61e
add some purity annotations in core
2012-06-02 10:08:00 -07:00