rust/src/liballoc
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
..
arc.rs Register new snapshots 2015-04-28 17:23:45 -07:00
boxed_test.rs Fallout in libstd: remove impls now considered to conflict. 2015-04-01 11:21:42 -04:00
boxed.rs Add downcasting to std::error::Error 2015-04-30 18:20:22 -07:00
heap.rs std: Prepare for linking to musl 2015-04-27 10:11:15 -07:00
lib.rs Register new snapshots 2015-04-28 17:23:45 -07:00
rc.rs Register new snapshots 2015-04-28 17:23:45 -07:00