| Age | Commit message (Collapse) | Author | Lines |
|
This commit is an implementation of [RFC 565][rfc] which is a stabilization of
the `std::fmt` module and the implementations of various formatting traits.
Specifically, the following changes were performed:
[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0565-show-string-guidelines.md
* The `Show` trait is now deprecated, it was renamed to `Debug`
* The `String` trait is now deprecated, it was renamed to `Display`
* Many `Debug` and `Display` implementations were audited in accordance with the
RFC and audited implementations now have the `#[stable]` attribute
* Integers and floats no longer print a suffix
* Smart pointers no longer print details that they are a smart pointer
* Paths with `Debug` are now quoted and escape characters
* The `unwrap` methods on `Result` now require `Display` instead of `Debug`
* The `Error` trait no longer has a `detail` method and now requires that
`Display` must be implemented. With the loss of `String`, this has moved into
libcore.
* `impl<E: Error> FromError<E> for Box<Error>` now exists
* `derive(Show)` has been renamed to `derive(Debug)`. This is not currently
warned about due to warnings being emitted on stage1+
While backwards compatibility is attempted to be maintained with a blanket
implementation of `Display` for the old `String` trait (and the same for
`Show`/`Debug`) this is still a breaking change due to primitives no longer
implementing `String` as well as modifications such as `unwrap` and the `Error`
trait. Most code is fairly straightforward to update with a rename or tweaks of
method calls.
[breaking-change]
Closes #21436
|
|
r? @alexcrichton
|
|
After PR #19766 added implicit coersions `*mut T -> *const T`, the explicit casts can be removed.
(The number of such casts turned out to be relatively small).
|
|
From std::markers to std::marker.
|
|
Two errors in `std::sync` are currently missing implementations of the standard error trait because they contain types which aren't `Send`.
This PR therefore requires #21312.
|
|
As discussed with @aturon, this PR removes the `Send` bound from `std::error::Error`, allowing us to implement `Error` for error types containing non-`Send` types. Current examples include `PoisonError` and `TryLockError` from `std::sync` which contain a Guard that we don't want sent between tasks.
[breaking-change]
|
|
|
|
There are a large number of places that incorrectly refer
to deriving in comments, instead of derives.
If someone could look at src/etc/generate-deriving-span-tests.py,
I'm not sure how those tests were passing before/if they were.
|
|
Part of collections reform v1, #18424
Also, iteration is simplified:
```
before
test btree::map::bench::iter_1000 ... bench: 17177 ns/iter (+/- 6302)
test btree::map::bench::iter_100000 ... bench: 1735731 ns/iter (+/- 23908)
test btree::map::bench::iter_20 ... bench: 386 ns/iter (+/- 148)
after
test btree::map::bench::iter_1000 ... bench: 15777 ns/iter (+/- 346)
test btree::map::bench::iter_100000 ... bench: 1602604 ns/iter (+/- 73629)
test btree::map::bench::iter_20 ... bench: 339 ns/iter (+/- 91)
```
cc @gereeter @cgaebel
r? @Gankro
|
|
Simplify BTree's iterators, too.
|
|
Signed-off-by: Peter Atashian <retep998@gmail.com>
|
|
This is a [breaking-change] since `std::dynamic_lib::dl` is now
private.
When `LoadLibraryW()` fails, original code called `errno()` to get error
code. However, there was local allocation of `Vec` before
`LoadLibraryW()`, and it drops before `errno()`, and the drop
(deallocation) changed `errno`! Therefore `dynamic_lib::open()` thought
it always succeeded.
This commit fixes the issue.
This commit also sets Windows error mode during `LoadLibrary()` to
prevent "dll load failed" dialog.
|
|
From std::markers to std::marker.
|
|
Lets them build with the -dev, -nightly, or snapshot compiler
|
|
|
|
|
|
|
|
There are a large number of places that incorrectly refer
to deriving in comments, instead of derives.
Fixes #20984
|
|
|
|
|
|
In accordance with [collections reform part 2][rfc] this macro has been moved to
an external [bitflags crate][crate] which is [available though
crates.io][cratesio]. Inside the standard distribution the macro has been moved
to a crate called `rustc_bitflags` for current users to continue using.
[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0509-collections-reform-part-2.md
[crate]: https://github.com/rust-lang/bitflags
[cratesio]: http://crates.io/crates/bitflags
The major user of `bitflags!` in terms of a public-facing possibly-stable API
today is the `FilePermissions` structure inside of `std::io`. This user,
however, will likely no longer use `bitflags!` after I/O reform has landed. To
prevent breaking APIs today, this structure remains as-is.
Current users of the `bitflags!` macro should add this to their `Cargo.toml`:
bitflags = "0.1"
and this to their crate root:
#[macro_use] extern crate bitflags;
Due to the removal of a public macro, this is a:
[breaking-change]
|
|
I searched for times when we were hiding functions with # in the documentation,
and fixed them to not use it unless neccesary.
I also made random improvements whenever I changed something. For example,
I changed Example to Examples, for consistency.
Fixes #13423
|
|
|
|
**The implementation is a direct adaptation of libcxx's condition_variable implementation.**
I also added a wait_timeout_with method, which matches the second overload in C++'s condition_variable. The implementation right now is kind of dumb but it works. There is an outstanding issue with it: as is it doesn't support the use case where a user doesn't care about poisoning and wants to continue through poison.
r? @alexcrichton @aturon
|
|
**The implementation is a direct adaptation of libcxx's
condition_variable implementation.**
pthread_cond_timedwait uses the non-monotonic system clock. It's
possible to change the clock to a monotonic via pthread_cond_attr, but
this is incompatible with static initialization. To deal with this, we
calculate the timeout using the system clock, and maintain a separate
record of the start and end times with a monotonic clock to be used for
calculation of the return value.
|
|
This PR adds rules for negative implementations. It follows pretty much what the [RFC](https://github.com/rust-lang/rfcs/blob/master/text/0019-opt-in-builtin-traits.md) says with 1 main difference:
Instead of positive implementations override negative implementations, this have been implemented in a way that a negative implementation of `Trait` for `T` will overlap with a positive implementation, causing a coherence error.
@nikomatsakis r?
cc #13231
[breaking-change]
|
|
|
|
Fix std::sync::condvar::Condvar::notify_one docs
Reviewed-by: alexcrichton
|
|
|
|
expansion now uses `::std::hash::Hash::hash(&*__self_0_0, __arg_0)` instead of
`(*__self_0_0).hash(__arg_0)`
closes #21160
r? @alexcrichton
|
|
Fixes #16072
r? @huonw
|
|
Originally, this was going to be discussed and revisted, however I've been working on this for months, and a rebase on top of master was about 1 flight's worth of work so I just went ahead and did it.
This gets you as far as being able to target powerpc with, eg:
LD_LIBRARY_PATH=./x86_64-unknown-linux-gnu/stage2/lib/ x86_64-unknown-linux-gnu/stage2/bin/rustc -C linker=powerpc-linux-gnu-gcc --target powerpc-unknown-linux-gnu hello.rs
Would really love to get this out before 1.0. r? @alexcrichton
|
|
expansion now uses `::std::hash::Hash::hash(&*__self_0_0, __arg_0)` instead of
`(*__self_0_0).hash(__arg_0)`
closes #21160
|
|
It's passed to the underlying reader, so uninitialized memory == sad
times.
We might want to shrink the default buffer size as well. 64k is pretty
huge. Java uses 8k by default, and Go uses 4k for reference.
r? @alexcrichton
|
|
|
|
Also adjusted some of the FFI definitions because apparently they don't use the long pointer prefix.
Gives a free performance boost because `SRWLock` is several times faster than `CriticalRegion` on every Windows system tested.
Fixes #19962
|
|
It's passed to the underlying reader, so uninitialized memory == sad
times.
We might want to shrink the default buffer size as well. 64k is pretty
huge. Java uses 8k by default, and Go uses 4k for reference.
|
|
Signed-off-by: Peter Atashian <retep998@gmail.com>
|
|
r=brson
Closes #13871
|
|
|
|
Fixes #16072
|
|
Change any use of AtomicInt to AtomicIsize and AtomicUint to AtomicUsize
Closes #20893
[breaking-change]
|
|
|
|
|
|
This borrowed entirely from the mips definitions, and should be
revisited after it lands while testing.
|
|
|
|
|
|
|
|
Give mmap a page-aligned stack start address
Reviewed-by: Aatch
|
|
Add ExactSizeIterator impls for Hash{Map, Set, Table}
Reviewed-by: Gankro
|