<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/libstd/error.rs, branch 1.34.2</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.34.2</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.34.2'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2019-05-13T15:17:37+00:00</updated>
<entry>
<title>Destabilize the `Error::type_id` function</title>
<updated>2019-05-13T15:17:37+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2019-05-13T15:14:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0c235ed9b99a96ceb8dc6eab19cbc4f8fdb9454e'/>
<id>urn:sha1:0c235ed9b99a96ceb8dc6eab19cbc4f8fdb9454e</id>
<content type='text'>
This commit destabilizes the `Error::type_id` function in the standard library.
This does so by effectively reverting #58048, restoring the `#[unstable]`
attribute. The security mailing list has recently been notified of a
vulnerability relating to the stabilization of this function. First stabilized
in Rust 1.34.0, a stable function here allows users to implement a custom
return value for this function:

    struct MyType;

    impl Error for MyType {
	fn type_id(&amp;self) -&gt; TypeId {
	    // Enable safe casting to `String` by accident.
	    TypeId::of::&lt;String&gt;()
	}
    }

This, when combined with the `Error::downcast` family of functions, allows
safely casting a type to any other type, clearly a memory safety issue! A
security announcement will be shortly posted to the security mailing list as
well as the Rust Blog, and when those links are available they'll be filled in
for this PR as well.

This commit simply destabilizes the `Error::type_id` which, although breaking
for users since Rust 1.34.0, is hoped to have little impact and has been deemed
sufficient to mitigate this issue for the stable channel. The long-term fate of
the `Error::type_id` API will be discussed at #60784.
</content>
</entry>
<entry>
<title>Remove #[doc(hidden)] from Error::type_id</title>
<updated>2019-04-06T19:18:46+00:00</updated>
<author>
<name>Aaron Power</name>
<email>theaaronepower@gmail.com</email>
</author>
<published>2019-03-31T14:54:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c02a36acc170595c488ff96727515d8c56da7539'/>
<id>urn:sha1:c02a36acc170595c488ff96727515d8c56da7539</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #58302 - SimonSapin:tryfrom, r=alexcrichton</title>
<updated>2019-02-25T20:24:10+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2019-02-25T20:24:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=00aae71f503b1ab592f48de47dd30912f3858748'/>
<id>urn:sha1:00aae71f503b1ab592f48de47dd30912f3858748</id>
<content type='text'>
Stabilize TryFrom and TryInto with a convert::Infallible empty enum

This is the plan proposed in https://github.com/rust-lang/rust/issues/33417#issuecomment-423073898
</content>
</entry>
<entry>
<title>Fix tracking issue for error iterators</title>
<updated>2019-02-16T20:16:18+00:00</updated>
<author>
<name>Steven Fackler</name>
<email>sfackler@gmail.com</email>
</author>
<published>2019-02-16T20:16:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3ba617751500f6ce07e8344bbc1b55baf73d340d'/>
<id>urn:sha1:3ba617751500f6ce07e8344bbc1b55baf73d340d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Stabilize TryFrom and TryInto</title>
<updated>2019-02-13T17:00:18+00:00</updated>
<author>
<name>Simon Sapin</name>
<email>simon.sapin@exyr.org</email>
</author>
<published>2019-02-08T14:00:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c80a8f51dcdc90dd8a5234f3bef6160814eee5df'/>
<id>urn:sha1:c80a8f51dcdc90dd8a5234f3bef6160814eee5df</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #58289 - haraldh:master, r=sfackler</title>
<updated>2019-02-13T03:37:05+00:00</updated>
<author>
<name>Mazdak Farrokhzad</name>
<email>twingoow@gmail.com</email>
</author>
<published>2019-02-13T03:37:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5aa260a4b56b30e553f82ed31cba384cbf40ae5d'/>
<id>urn:sha1:5aa260a4b56b30e553f82ed31cba384cbf40ae5d</id>
<content type='text'>
impl iter() for dyn Error

Examples:

```rust
let next_error_type_a = err
    .iter()
    .filter_map(Error::downcast_ref::&lt;ErrorTypeA&gt;)
    .next();
```

```rust
let source_root_error = err.iter().last();
```

Credit for the ErrorIter goes to reddit user /u/tdiekmann (Tim Diekmann)
https://www.reddit.com/r/rust/comments/aj3lpg/is_an_iterator_impl_over_errorsource_possible/
</content>
</entry>
<entry>
<title>libs: doc comments</title>
<updated>2019-02-10T23:57:25+00:00</updated>
<author>
<name>Alexander Regueiro</name>
<email>alexreg@me.com</email>
</author>
<published>2019-02-09T22:16:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=99ed06eb8864e704c4a1871ccda4648273bee4ef'/>
<id>urn:sha1:99ed06eb8864e704c4a1871ccda4648273bee4ef</id>
<content type='text'>
</content>
</entry>
<entry>
<title>impl iter_sources() and iter_chain() for dyn Error</title>
<updated>2019-02-09T15:04:25+00:00</updated>
<author>
<name>Harald Hoyer</name>
<email>harald@redhat.com</email>
</author>
<published>2019-02-07T15:10:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f06af1ff178014dadd62391a4a06e7fff8f2a6a1'/>
<id>urn:sha1:f06af1ff178014dadd62391a4a06e7fff8f2a6a1</id>
<content type='text'>
Examples:

```rust
let next_error_type_a = err
    .iter_chain()
    .filter_map(Error::downcast_ref::&lt;ErrorTypeA&gt;)
    .next();
```

```rust
let source_root_error = err.iter_chain().last();
```

Credit for the ErrorIter goes to Tim Diekmann
https://www.reddit.com/r/rust/comments/aj3lpg/is_an_iterator_impl_over_errorsource_possible/
</content>
</entry>
<entry>
<title>Stabilize std::error::Error::type_id</title>
<updated>2019-02-01T10:29:02+00:00</updated>
<author>
<name>Simon Sapin</name>
<email>simon.sapin@exyr.org</email>
</author>
<published>2019-02-01T10:29:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=cc1e05f0ca92805d17aaba5613f85287c9ce8dd7'/>
<id>urn:sha1:cc1e05f0ca92805d17aaba5613f85287c9ce8dd7</id>
<content type='text'>
This should have been part of https://github.com/rust-lang/rust/pull/57834

FCP: https://github.com/rust-lang/rust/issues/27745#issuecomment-373906749
</content>
</entry>
<entry>
<title>Change std::error::Error trait documentation to talk about `source` instead of `cause`</title>
<updated>2019-01-08T22:45:54+00:00</updated>
<author>
<name>Czipperz</name>
<email>czipperz@gmail.com</email>
</author>
<published>2018-12-29T07:09:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=564a24c772c6eb6dcad0388a80b8987bc57bf614'/>
<id>urn:sha1:564a24c772c6eb6dcad0388a80b8987bc57bf614</id>
<content type='text'>
</content>
</entry>
</feed>
