rust/src/libstd
Aaron Turon a5762625a1 Add downcasting to std::error::Error
This commit brings the `Error` trait in line with the [Error interoperation
RFC](https://github.com/rust-lang/rfcs/pull/201) by adding downcasting,
which has long been intended. This change means that for any `Error`
trait objects that are `'static`, you can downcast to concrete error
types.

To make this work, it is necessary for `Error` to inherit from
`Reflect` (which is currently used to mark concrete types as "permitted
for reflection, aka downcasting"). This is a breaking change: it means
that impls like

```rust
impl<T> Error for MyErrorType<T> { ... }
```

must change to something like

```rust
impl<T: Reflect> Error for MyErrorType<T> { ... }
```

except that `Reflect` is currently unstable (and should remain so for
the time being). For now, code can instead bound by `Any`:

```rust
impl<T: Any> Error for MyErrorType<T> { ... }
```

which *is* stable and has `Reflect` as a super trait. The downside is
that this imposes a `'static` constraint, but that only
constrains *when* `Error` is implemented -- it does not actually
constrain the types that can implement `Error`.

[breaking-change]
2015-04-30 18:20:22 -07:00
..
collections Register new snapshots 2015-04-28 17:23:45 -07:00
ffi std: Remove deprecated AsOsStr/Str/AsSlice traits 2015-04-21 11:37:34 -07:00
io Add downcasting to std::error::Error 2015-04-30 18:20:22 -07:00
net rollup merge of #24961: nham/net_docs_cleanup 2015-04-29 15:45:57 -07:00
num std: Bring back f32::from_str_radix as an unstable API 2015-04-21 15:23:54 -07:00
os std: Expand the area of std::fs 2015-04-27 17:16:44 -07:00
prelude std: Add Default/IntoIterator/ToOwned to the prelude 2015-04-17 16:37:30 -07:00
rand Change name of unit test sub-module to "tests". 2015-04-24 23:06:41 +02:00
rt Register new snapshots 2015-04-28 17:23:45 -07:00
sync Add downcasting to std::error::Error 2015-04-30 18:20:22 -07:00
sys Add downcasting to std::error::Error 2015-04-30 18:20:22 -07:00
thread rollup merge of #24926: frewsxcv/patch-20 2015-04-29 15:45:49 -07:00
time std: Remove deprecated/unstable num functionality 2015-04-21 11:37:43 -07:00
array.rs rustdoc: Support for "array" primitive 2015-03-23 14:02:34 -07:00
ascii.rs Model lexer: Fix remaining issues 2015-04-21 12:02:12 +02:00
bool.rs
dynamic_lib.rs std: Prepare for linking to musl 2015-04-27 10:11:15 -07:00
env.rs rollup merge of #24636: alexcrichton/remove-deprecated 2015-04-21 15:28:53 -07:00
error.rs Add downcasting to std::error::Error 2015-04-30 18:20:22 -07:00
fs.rs std: Implement fs::DirBuilder 2015-04-28 17:38:26 -07:00
lib.rs Fallout 2015-04-29 08:55:31 -07:00
macros.rs Register new snapshots 2015-04-28 17:23:45 -07:00
panicking.rs std: Don't assume thread::current() works on panic 2015-04-27 16:15:36 -07:00
path.rs add import (fixup #24649) 2015-04-25 22:33:19 +05:30
process.rs Update process.rs 2015-04-29 18:21:23 -04:00
rtdeps.rs std: Prepare for linking to musl 2015-04-27 10:11:15 -07:00
thunk.rs Remove Thunk struct and Invoke trait; change Thunk to be an alias 2015-04-01 14:41:21 -04:00
tuple.rs Remove doc-comment default::Default imports 2015-04-22 09:42:36 -04:00
unit.rs