| Age | Commit message (Collapse) | Author | Lines |
|
|
|
I feel it's time to eliminate them (and add some testcases.)
|
|
Basically, generic containers should not use the default methods since a
type of elements may not guarantees total order. str could use them
since u8's Ord guarantees total order. Floating point numbers are also
broken with the default methods because of NaN. Thanks for @thestinger.
Timespec also guarantees total order AIUI. I'm unsure whether
extra::semver::Identifier does so I left it alone. Proof needed.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
|
|
Code that collects fields in struct-like patterns used to ignore
wildcard patterns like `Foo{_}`. But `enter_defaults` considered
struct-like patterns as default in order to overcome this
(accoring to my understanding of situation).
However such behaviour caused code like this:
```
enum E {
Foo{f: int},
Bar
}
let e = Bar;
match e {
Foo{f: _f} => { /* do something (1) */ }
_ => { /* do something (2) */ }
}
```
consider pattern `Foo{f: _f}` as default. That caused inproper behaviour
and even segfaults while trying to destruct `Bar` as `Foo{f: _f}`.
Issues: #5625 , #5530.
This patch fixes `collect_record_or_struct_fields` to split cases of
single wildcard struct-like pattern and no struct-like pattern at all.
Former case resolved with `enter_rec_or_struct` (and not with
`enter_defaults`).
Closes #5625.
Closes #5530.
|
|
FromStr implemented from scratch.
It is overengineered a bit, however.
Old implementation handles errors by fail!()-ing. And it has bugs, like it accepts `127.0.0.1::127.0.0.1` as IPv6 address, and does not handle all ipv4-in-ipv6 schemes. So I decided to implement parser from scratch.
|
|
This pull request converts the scheduler from a naive shared queue scheduler to a naive workstealing scheduler. The deque is still a queue inside a lock, but there is still a substantial performance gain. Fiddling with the messaging benchmark I got a ~10x speedup and observed massively reduced memory usage.
There are still *many* locations for optimization, but based on my experience so far it is a clear performance win as it is now.
|
|
This is a fairly large rollup, but I've tested everything locally, and none of
it should be platform-specific.
r=alexcrichton (bdfdbdd)
r=brson (d803c18)
r=alexcrichton (a5041d0)
r=bstrie (317412a)
r=alexcrichton (135c85e)
r=thestinger (8805baa)
r=pcwalton (0661178)
r=cmr (9397fe0)
r=cmr (caa4135)
r=cmr (6a21d93)
r=cmr (4dc3379)
r=cmr (0aa5154)
r=cmr (18be261)
r=thestinger (f10be03)
|
|
queue shared by each scheduler. Now there is a separate work queue for each scheduler, and work is "stolen" from other queues when it is exhausted locally.
|
|
|
|
|
|
This is a reopening of #8182, although this removes any abuse of the compiler internals. Now it's just a pure syntax extension (hard coded what the attribute names are).
|
|
|
|
|
|
#8192.
|
|
.each_key(), .each_value() and the other methods are replaced by .iter()
and .rev_iter(), and restrictions of those iterators.
|
|
Implement reverse iterators for TreeMap and TreeSet, that produce the
keys in backward order.
|
|
Write external iterators for Difference, Sym. Difference, Intersection
and Union set operations.
These iterators are generic insofar that they could work on any ordered
sequence iterators, even though they are type specialized to the
TreeSetIterator in this case.
Looking at the `check` function in the treeset tests, rustc seems
unwilling to compile a function resembling::
fn check<'a, T: Iterator<&'a int>>(... )
so the tests for these iterators are still running the legacy loop
protocol.
|
|
Write the Eq and Ord impls for TreeMap in a more straightforward way
using iterator::Zip
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This way opt_present("apple") will match no matter if the user passed -a or --apple
|
|
|
|
This is everywhere except struct fields and enum variants.
|
|
Range is now invertable as long as its element type conforms to Integer.
Remove int::range_rev() et al in favor of range().invert().
|
|
Transform range loops that can be regular iterator loops.
|
|
Edge iterator used the length of the nodes vector, must be a mistake.
|
|
Fix inappropriate for-range loops to use for-iterator constructs (or
other appropriate solution) instead.
|
|
|
|
The new macro is available under the name ifmt! (only an intermediate name)
|
|
|
|
|
|
Segfaulted on one of the bots. Maybe out of stack?
|
|
The implementation currently contains a race that leads to segfaults.
|
|
Don't understand why this broke.
|
|
|
|
|
|
Seems to not work
|
|
|
|
|
|
|
|
|