| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
`push_bytes` is implemented with `ptr::copy_memory` here since this
function is intended to be used to implement `.push_str()` for str, so
we want to avoid the overhead.
|
|
Issue #8742
Add the method `.reserve_additional(n: uint)`: Check for overflow in
self.len() + n, and reserve that many elements (rounded up to next power
of two). Does nothing if self.len() + n < self.capacity() already.
|
|
A SendStr is a string that can hold either a ~str or a &'static str.
This can be useful as an optimization when an allocation is sometimes needed but the common case is statically known.
Possible use cases include Maps with both static and owned keys, or propagating error messages across task boundaries.
SendStr implements most basic traits in a way that hides the fact that it is an enum; in particular things like order and equality are only determined by the content of the wrapped strings.
This basically reimplements #7599 and has a use case for replacing an similar type in `std::rt::logging` ( Added in #9180).
|
|
Split up test function a bit
|
|
A SendStr is a string that can hold either a ~str or a &'static str.
This can be useful as an optimization when an allocation is sometimes needed but the common case is statically known.
Possible use cases include Maps with both static and owned keys, or propagating error messages across task boundaries.
SendStr implements most basic traits in a way that hides the fact that it is an enum; in particular things like order and equality are only determined by the content of the wrapped strings.
Replaced std::rt:logging::SendableString with SendStr
Added tests for using an SendStr as key in Hash- and Treemaps
|
|
Like next_power_of_two, but returns None on overflow.
|
|
Also rustify .as_bytes(), so it no longer calls libc::strlen() and is
inlineable.
|
|
Closes #8814.
|
|
Closes #8816.
|
|
Fixes `connect_error` part of #8811.
|
|
Also enables request_sanity_check() test.
Closes #8817
|
|
FormatMessageA may return non-ascii message,
which is encoded as system code page, not utf8.
This may cause `assert!(is_utf8(v))` failure on
some non-English machines.
This patch replaces it with FormatMessageW,
which returns utf-16 message.
Fixes `make check-stage2-std` failure on my machine. :)
|
|
Assumes drive C: exists.
Closes #8812.
|
|
Enable blocked tests which are now fixed by #9165.
Closes #8810.
|
|
Remove these in favor of the two traits themselves and the wrapper
function std::from_str::from_str.
Add the function std::num::from_str_radix in the corresponding role for
the FromStrRadix trait.
|
|
|
|
This renames the syntax-extension file to format from ifmt, and it also reduces
the amount of complexity inside by defining all other macros in terms of
format_args!
|
|
|
|
|
|
Replaced by `std::iter::range_step`
|
|
Use the iterator version instead of the old uint::/int::range_step
functions.
|
|
|
|
|
|
|
|
My focus was on getting these to be correct in all cases by handling overflow properly. I'll clean them up and work on the performance later.
|
|
|
|
SharedPort implementation was missing in std::comm. Since this module
also wraps SharedChan, it makes sense to have SharedPort defined there
as well.
|
|
Allows `std::rt::io::timer::sleep(1000)` rather than `std::rt::io::timer::Timer::new().unwrap().sleep(1000)`.
|
|
|
|
|
|
SharedPort implementation was missing in std::comm. Since this module
also wraps SharedChan, it makes sense to have SharedPort defined there
as well.
|
|
|
|
Somehow this was missed!
cc #4819
|
|
Work a bit towards #9157 "Remove Either". These instances don't need to use Either and are better expressed in other ways (removing allocations and simplifying types).
|
|
|
|
It was broken on win32 because of header inconsistency.
|
|
Remove references to local_data::Key and only mention the macro for how to
construct new keys into local data.
|
|
This is a workaround for #9155. Currently, any uses of BufferedStream
outside of libstd ICE.
|
|
This is a series of patches to modernize option and result. The highlights are:
* rename `.unwrap_or_default(value)` and etc to `.unwrap_or(value)`
* add `.unwrap_or_default()` that uses the `Default` trait
* add `Default` implementations for vecs, HashMap, Option
* add `Option.and(T) -> Option<T>`, `Option.and_then(&fn() -> Option<T>) -> Option<T>`, `Option.or(T) -> Option<T>`, and `Option.or_else(&fn() -> Option<T>) -> Option<T>`
* add `option::ToOption`, `option::IntoOption`, `option::AsOption`, `result::ToResult`, `result::IntoResult`, `result::AsResult`, `either::ToEither`, and `either::IntoEither`, `either::AsEither`
* renamed `Option::chain*` and `Result::chain*` to `and_then` and `or_else` to avoid the eventual collision with `Iterator.chain`.
* Added a bunch of impls of `Default`
* Added a `#[deriving(Default)]` syntax extension
* Removed impls of `Zero` for `Option<T>` and vecs.
|
|
While usage of change_dir_locked is synchronized against itself, it's not
synchronized against other relative path usage, so I'm of the opinion that it
just really doesn't help in running tests. In order to prevent the problems that
have been cropping up, this completely removes the function.
All existing tests (except one) using it have been moved to run-pass tests where
they get their own process and don't need to be synchronized with anyone else.
There is one now-ignored rustpkg test because when I moved it to a run-pass test
apparently run-pass isn't set up to have 'extern mod rustc' (it ends up having
linkage failures).
|
|
|
|
|
|
|
|
|
|
It was broken on win32 because of header inconsistency.
|
|
Remove references to local_data::Key and only mention the macro for how to
construct new keys into local data.
|
|
This patch converts the rust_crate_map.cpp to Rust as mentioned at the end of #8880.
|
|
This is a workaround for #9155. Currently, any uses of BufferedStream
outside of libstd ICE.
|