| Age | Commit message (Collapse) | Author | Lines |
|
Part of #8784
Also removed the one glob import.
|
|
This "bubble up an error" macro was originally named if_ok! in order to get it
landed, but after the fact it was discovered that this name is not exactly
desirable.
The name `if_ok!` isn't immediately clear that is has much to do with error
handling, and it doesn't look fantastic in all contexts (if if_ok!(...) {}). In
general, the agreed opinion about `if_ok!` is that is came in as subpar.
The name `try!` is more invocative of error handling, it's shorter by 2 letters,
and it looks fitting in almost all circumstances. One concern about the word
`try!` is that it's too invocative of exceptions, but the belief is that this
will be overcome with documentation and examples.
Close #12037
|
|
|
|
|
|
Preparatory work for removing unique vectors from the language, which is
itself preparatory work for dynamically sized types.
|
|
|
|
It is sometimes useful to parse just the path portion of a URL (path,
query string and fragment) rather than the entire URL.
In theory I could have made Url embed a Path, but that would be a
breaking change and I assume that Servo uses this API. I would be
happy to update the PR to embed Path in Url if that's what people
wanted.
|
|
|
|
|
|
|
|
|
|
Delete all the documentation from std::task that references linked
failure.
Tweak TaskBuilder to be more builder-like. `.name()` is now `.named()` and
`.add_wrapper()` is now `.with_wrapper()`. Remove `.watched()` and
`.unwatched()` as they didn't actually do anything.
Closes #6399.
|
|
|
|
Bitwise::count_zeros
These are inspired by the [functions in the Julia standard library](http://docs.julialang.org/en/release-0.2/stdlib/base/#Base.count_ones).
|
|
|
|
It's too easy to forget the `rust` tag to test something.
Closes #11698
|
|
|
|
This was previously implemented, and it just needed a snapshot to go through
|
|
|
|
When tests fail, their stdout and stderr is printed as part of the summary, but
this helps suppress failure messages from #[should_fail] tests and generally
clean up the output of the test runner.
|
|
|
|
mut_offset)
|
|
|
|
|
|
It is sometimes useful to parse just the path portion of a URL (path,
query string and fragment) rather than the entire URL.
|
|
This, the Nth rewrite of channels, is not a rewrite of the core logic behind
channels, but rather their API usage. In the past, we had the distinction
between oneshot, stream, and shared channels, but the most recent rewrite
dropped oneshots in favor of streams and shared channels.
This distinction of stream vs shared has shown that it's not quite what we'd
like either, and this moves the `std::comm` module in the direction of "one
channel to rule them all". There now remains only one Chan and one Port.
This new channel is actually a hybrid oneshot/stream/shared channel under the
hood in order to optimize for the use cases in question. Additionally, this also
reduces the cognitive burden of having to choose between a Chan or a SharedChan
in an API.
My simple benchmarks show no reduction in efficiency over the existing channels
today, and a 3x improvement in the oneshot case. I sadly don't have a
pre-last-rewrite compiler to test out the old old oneshots, but I would imagine
that the performance is comparable, but slightly slower (due to atomic reference
counting).
This commit also brings the bonus bugfix to channels that the pending queue of
messages are all dropped when a Port disappears rather then when both the Port
and the Chan disappear.
|
|
Removed use of globs present in earlier versions of modules.
Fix tutorial.md to reflect `extra::rational` ==> `num::rational`.
|
|
Also move Void to std::any, move drop to std::mem and reexport in
prelude.
|
|
This allows a result to be marked as "used" by passing it to a function
LLVM cannot see inside (unless LTO is enabled).
Closes #8261.
|
|
benchmarking.
This allows a result to be marked as "used" by passing it to a function
LLVM cannot see inside. By making `iter` generic and using this
`black_box` on the result benchmarks can get this behaviour simply by
returning their computation.
|
|
MaybeOwned allows from_utf8_lossy to avoid allocation if there are no
invalid bytes in the input.
Before:
```
test str::bench::from_utf8_lossy_100_ascii ... bench: 183 ns/iter (+/- 5)
test str::bench::from_utf8_lossy_100_invalid ... bench: 341 ns/iter (+/- 15)
test str::bench::from_utf8_lossy_100_multibyte ... bench: 227 ns/iter (+/- 13)
test str::bench::from_utf8_lossy_invalid ... bench: 102 ns/iter (+/- 4)
test str::bench::is_utf8_100_ascii ... bench: 2 ns/iter (+/- 0)
test str::bench::is_utf8_100_multibyte ... bench: 2 ns/iter (+/- 0)
```
Now:
```
test str::bench::from_utf8_lossy_100_ascii ... bench: 96 ns/iter (+/- 4)
test str::bench::from_utf8_lossy_100_invalid ... bench: 318 ns/iter (+/- 10)
test str::bench::from_utf8_lossy_100_multibyte ... bench: 105 ns/iter (+/- 2)
test str::bench::from_utf8_lossy_invalid ... bench: 105 ns/iter (+/- 2)
test str::bench::is_utf8_100_ascii ... bench: 2 ns/iter (+/- 0)
test str::bench::is_utf8_100_multibyte ... bench: 2 ns/iter (+/- 0)
```
|
|
Declare a `type SendStr = MaybeOwned<'static>` to ease readibility of
types that needed the old SendStr behavior.
Implement all the traits for MaybeOwned that SendStr used to implement.
|
|
Avoid using -1 as a char sentinel, when Option<char> is the perfect
thing.
|
|
|
|
|
|
|
|
|
|
This complements `usage` by auto-generating a short one-liner summary
of the options.
(First timer here, be gentle... :)
|
|
- `extra::json` didn't make the cut, because of `extra::json` required
dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`,
then `extra::json` could move into `serialize`
- `libextra`, `libsyntax` and `librustc` depend on the newly created
`libserialize`
- The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap`
and `TreeSet` for `Encodable`/`Decodable` were moved into the respective
modules in `extra`
- There is some trickery, evident in `src/libextra/lib.rs` where a stub
of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for
use in the stage0 build, where the snapshot rustc is still making
deriving for `Encodable` and `Decodable` point at extra. Big props to
@huonw for help working out the re-export solution for this
extra: inline extra::serialize stub
fix stuff clobbered in rebase + don't reexport serialize::serialize
no more globs in libserialize
syntax: fix import of libserialize traits
librustc: fix bad imports in encoder/decoder
add serialize dep to librustdoc
fix failing run-pass tests w/ serialize dep
adjust uuid dep
more rebase de-clobbering for libserialize
fixing tests, pushing libextra dep into cfg(test)
fix doc code in extra::json
adjust index.md links to serialize and uuid library
|
|
|
|
This allows patch adds a new arc type that allows for creation of copy-on-write data structures. The idea is that it is safe to mutate any data structure as long as it has only one reference to it. If there are multiple, it requires cloning of the data structure before mutation is possible.
|
|
|
|
Changes in std::{str,vec,hashmap} and extra::{priority_queue,ringbuf}.
Fixes #11949
|
|
|
|
cc #8784
|
|
Changes in std::{str,vec,hashmap} and extra::{priority_queue,ringbuf}.
Fixes #11949
|
|
cc #10834
|
|
cc #10834
|
|
Done as a part of #8784.
|
|
|