Skip to content

Commit fe2d07d

Browse files
committed
added hidden nonexaustive variant
fixes rust-lang-deprecated#182
1 parent c723ff7 commit fe2d07d

File tree

10 files changed

+171
-118
lines changed

10 files changed

+171
-118
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ env:
3535
global:
3636
- secure: ncxJbvJM1vCZfcEftjsFKJMxxhKLgWKaR8Go9AMo0VB5fB2XVW/6NYO5bQEEYpOf1Nc/+2FbI2+Dkz0S/mJpUcNSfBgablCHgwU2sHse7KsoaqfHj2mf1E3exjzSHoP96hPGicC5zAjSXFjCgJPOUSGqqRaJ7z5AsJLhJT6LuK7QpvwPBZzklUN8T+n1sVmws8TNmRIbaniq/q6wYHANHcy6Dl59dx4sKwniUGiZdUhCiddVpoxbECSxc0A8mN2pk7/aW+WGxK3goBs5ZF7+JXF318F62pDcXQmR5CX6WdpenIcJ25g1Vg1WhQ4Ifpe17CN0bfxV8ShuzrQUThCDMffZCo9XySBtODdEowwK1UIpjnFLfIxjOs45Cd8o3tM2j0CfvtnjOz6BCdUU0qiwNPPNx0wFkx3ZiOfSh+FhBhvyPM12HN2tdN0esgVBItFmEci+sSIIXqjVL6DNiu5zTjbu0bs6COwlUWdmL6vmsZtq5tl7Cno9+C3szxRVAkShGydd04l9NYjqNEzTa1EPG50OsnVRKGdRiFzSxhc3BWExNKvcQ4v867t6/PpPkW6s4oXmYI3+De+8O7ExWc6a4alcrDXKlMs5fCb5Pcd4Ju9kowcjkoJo5yf2wW3Ox5R8SJpaEEpvyhx5O/qtIxjhHNzeo8Wsr/6gdNDv20r91TI=
3737
- TRAVIS_CARGO_NIGHTLY_FEATURE=""
38+
- RUSTFLAGS="-D warnings"
3839
matrix:
3940
- FEATURES=--features=backtrace
4041
- FEATURES=--no-default-features

CHANGELOG.md

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
1-
# Unreleased
1+
# 0.11.0-rc.2
22

3-
- [Add a new method for `Error`: `chain_err`.](https://github.com/brson/error-chain/pull/141)
4-
- [Allow `chain_err` to be used on `Option<T>`](https://github.com/brson/error-chain/pull/156)
5-
- [Add support for creating an error chain on boxed trait errors (`Box<Error>`)](https://github.com/brson/error-chain/pull/156)
3+
- [Make `ErrorChainIter`'s field private](https://github.com/rust-lang-nursery/error-chain/issues/178)
4+
- [Rename `ErrorChainIter` to `Iter`](https://github.com/rust-lang-nursery/error-chain/issues/168)
5+
- [Implement `Debug` for `ErrorChainIter`](https://github.com/rust-lang-nursery/error-chain/issues/169)
6+
- [Rename `ChainedError::display` to `display_chain`](https://github.com/rust-lang-nursery/error-chain/issues/180)
7+
- [Add a new method for `Error`: `chain_err`.](https://github.com/rust-lang-nursery/error-chain/pull/141)
8+
- [Allow `chain_err` to be used on `Option<T>`](https://github.com/rust-lang-nursery/error-chain/pull/156)
9+
- [Add support for creating an error chain on boxed trait errors (`Box<Error>`)](https://github.com/rust-lang-nursery/error-chain/pull/156)
10+
- [Remove lint for unused doc comment.](https://github.com/rust-lang-nursery/error-chain/pull/199)
611

712
# 0.10.0
813

9-
- [Add a new constructor for `Error`: `with_chain`.](https://github.com/brson/error-chain/pull/126)
10-
- [Add the `ensure!` macro.](https://github.com/brson/error-chain/pull/135)
14+
- [Add a new constructor for `Error`: `with_chain`.](https://github.com/rust-lang-nursery/error-chain/pull/126)
15+
- [Add the `ensure!` macro.](https://github.com/rust-lang-nursery/error-chain/pull/135)
1116

1217
# 0.9.0
1318

14-
- Revert [Add a `Sync` bound to errors](https://github.com/brson/error-chain/pull/110)
19+
- Revert [Add a `Sync` bound to errors](https://github.com/rust-lang-nursery/error-chain/pull/110)
1520

1621
# 0.8.1
1722

18-
- Add crates.io categorie.
23+
- Add crates.io category.
1924

2025
# 0.8.0
2126

22-
- [Add a `Sync` bound to errors](https://github.com/brson/error-chain/pull/110)
23-
- [Add `ChainedError::display` to format error chains](https://github.com/brson/error-chain/pull/113)
27+
- [Add a `Sync` bound to errors](https://github.com/rust-lang-nursery/error-chain/pull/110)
28+
- [Add `ChainedError::display` to format error chains](https://github.com/rust-lang-nursery/error-chain/pull/113)
2429

2530
# 0.7.2
2631

@@ -30,11 +35,11 @@
3035

3136
# 0.7.1
3237

33-
- [Add the `bail!` macro](https://github.com/brson/error-chain/pull/76)
38+
- [Add the `bail!` macro](https://github.com/rust-lang-nursery/error-chain/pull/76)
3439

3540
# 0.7.0
3641

37-
- [Rollback several design changes to fix regressions](https://github.com/brson/error-chain/pull/75)
42+
- [Rollback several design changes to fix regressions](https://github.com/rust-lang-nursery/error-chain/pull/75)
3843
- New `Variant(Error) #[attrs]` for `links` and `foreign_links`.
3944
- Hide implementation details from the doc.
4045
- Always generate `Error::backtrace`.
@@ -64,41 +69,41 @@
6469

6570
# 0.5.0
6671

67-
- [Only generate backtraces with RUST_BACKTRACE set](https://github.com/brson/error-chain/pull/27)
68-
- [Fixup matching, disallow repeating "types" section](https://github.com/brson/error-chain/pull/26)
69-
- [Fix tests on stable/beta](https://github.com/brson/error-chain/pull/28)
70-
- [Only deploy docs when tagged](https://github.com/brson/error-chain/pull/30)
72+
- [Only generate backtraces with RUST_BACKTRACE set](https://github.com/rust-lang-nursery/error-chain/pull/27)
73+
- [Fixup matching, disallow repeating "types" section](https://github.com/rust-lang-nursery/error-chain/pull/26)
74+
- [Fix tests on stable/beta](https://github.com/rust-lang-nursery/error-chain/pull/28)
75+
- [Only deploy docs when tagged](https://github.com/rust-lang-nursery/error-chain/pull/30)
7176

7277
Contributors: benaryorg, Brian Anderson, Georg Brandl
7378

7479
# 0.4.2
7580

76-
- [Fix the resolution of the ErrorKind description method](https://github.com/brson/error-chain/pull/24)
81+
- [Fix the resolution of the ErrorKind description method](https://github.com/rust-lang-nursery/error-chain/pull/24)
7782

7883
Contributors: Brian Anderson
7984

8085
# 0.4.1 (yanked)
8186

82-
- [Fix a problem with resolving methods of the standard Error type](https://github.com/brson/error-chain/pull/22)
87+
- [Fix a problem with resolving methods of the standard Error type](https://github.com/rust-lang-nursery/error-chain/pull/22)
8388

8489
Contributors: Brian Anderson
8590

8691
# 0.4.0 (yanked)
8792

88-
- [Remove the foreign link description and forward to the foreign error](https://github.com/brson/error-chain/pull/19)
89-
- [Allow missing sections](https://github.com/brson/error-chain/pull/17)
93+
- [Remove the foreign link description and forward to the foreign error](https://github.com/rust-lang-nursery/error-chain/pull/19)
94+
- [Allow missing sections](https://github.com/rust-lang-nursery/error-chain/pull/17)
9095

9196
Contributors: Brian Anderson, Taylor Cramer
9297

9398
# 0.3.0
9499

95-
- [Forward Display implementation for foreign errors](https://github.com/brson/error-chain/pull/13)
100+
- [Forward Display implementation for foreign errors](https://github.com/rust-lang-nursery/error-chain/pull/13)
96101

97102
Contributors: Brian Anderson, Taylor Cramer
98103

99104
# 0.2.2
100105

101-
- [Don't require `types` section in macro invocation](https://github.com/brson/error-chain/pull/8)
102-
- [Add "quick start" to README](https://github.com/brson/error-chain/pull/9)
106+
- [Don't require `types` section in macro invocation](https://github.com/rust-lang-nursery/error-chain/pull/8)
107+
- [Add "quick start" to README](https://github.com/rust-lang-nursery/error-chain/pull/9)
103108

104109
Contributors: Brian Anderson, Jake Shadle, Nate Mara

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[package]
2-
32
name = "error-chain"
4-
version = "0.10.1-pre"
3+
version = "0.11.0-rc.2" # remember to update html_root_url
54
authors = [ "Brian Anderson <[email protected]>",
65
"Paul Colomiets <[email protected]>",
76
"Colin Kiegel <[email protected]>",
87
"Yamakaky <[email protected]>"]
98
description = "Yet another error boilerplate library."
9+
keywords = ["error"]
1010
categories = ["rust-patterns"]
1111

1212
documentation = "https://docs.rs/error-chain"
13-
homepage = "https://github.com/brson/error-chain"
14-
repository = "https://github.com/brson/error-chain"
13+
repository = "https://github.com/rust-lang-nursery/error-chain"
14+
readme = "README.md"
1515

1616
license = "MIT/Apache-2.0"
1717

1818
[badges]
19-
travis-ci = { repository = "brson/error-chain" }
19+
travis-ci = { repository = "rust-lang-nursery/error-chain" }
2020

2121
[features]
2222
default = ["backtrace", "example_generated"]

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# error-chain - Consistent error handling for Rust
22

3-
[![Build Status](https://api.travis-ci.org/brson/error-chain.svg?branch=master)](https://travis-ci.org/brson/error-chain)
3+
[![Build Status](https://api.travis-ci.org/rust-lang-nursery/error-chain.svg?branch=master)](https://travis-ci.org/rust-lang-nursery/error-chain)
44
[![Latest Version](https://img.shields.io/crates/v/error-chain.svg)](https://crates.io/crates/error-chain)
5-
[![License](https://img.shields.io/github/license/brson/error-chain.svg)](https://github.com/brson/error-chain)
5+
[![License](https://img.shields.io/github/license/rust-lang-nursery/error-chain.svg)](https://github.com/rust-lang-nursery/error-chain)
66

77
`error-chain` makes it easy to take full advantage of Rust's error
88
handling features without the overhead of maintaining boilerplate
@@ -12,15 +12,15 @@ error types.
1212

1313
[Documentation (crates.io)](https://docs.rs/error-chain).
1414

15-
[Documentation (master)](https://brson.github.io/error-chain).
15+
[Documentation (master)](https://rust-lang-nursery.github.io/error-chain).
1616

1717
## Quick start
1818

1919
If you just want to set up your new project with error-chain,
2020
follow the [quickstart.rs] template, and read this [intro]
2121
to error-chain.
2222

23-
[quickstart.rs]: https://github.com/brson/error-chain/blob/master/examples/quickstart.rs
23+
[quickstart.rs]: https://github.com/rust-lang-nursery/error-chain/blob/master/examples/quickstart.rs
2424
[intro]: http://brson.github.io/2016/11/30/starting-with-error-chain
2525

2626
## Supported Rust version

examples/quickstart.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ fn main() {
4646

4747
// The above main gives you maximum control over how the error is
4848
// formatted. If you don't care (i.e. you want to display the full
49-
// error during an assert) you can just call the `display` method
49+
// error during an assert) you can just call the `display_chain` method
5050
// on the error object
5151
#[allow(dead_code)]
5252
fn alternative_main() {
5353
if let Err(ref e) = run() {
5454
use std::io::Write;
55-
use error_chain::ChainedError; // trait which holds `display`
55+
use error_chain::ChainedError; // trait which holds `display_chain`
5656
let stderr = &mut ::std::io::stderr();
5757
let errmsg = "Error writing to stderr";
5858

59-
writeln!(stderr, "{}", e.display()).expect(errmsg);
59+
writeln!(stderr, "{}", e.display_chain()).expect(errmsg);
6060
::std::process::exit(1);
6161
}
6262
}

src/error_chain.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ macro_rules! error_chain_processed {
9696
self.kind()
9797
}
9898

99-
fn iter(&self) -> $crate::ErrorChainIter {
100-
$crate::ErrorChainIter(Some(self))
99+
fn iter(&self) -> $crate::Iter {
100+
$crate::Iter::new(Some(self))
101101
}
102102

103103
fn chain_err<F, EK>(self, error: F) -> Self
@@ -151,7 +151,7 @@ macro_rules! error_chain_processed {
151151
}
152152

153153
/// Iterates over the error chain.
154-
pub fn iter(&self) -> $crate::ErrorChainIter {
154+
pub fn iter(&self) -> $crate::Iter {
155155
$crate::ChainedError::iter(self)
156156
}
157157

@@ -172,6 +172,7 @@ macro_rules! error_chain_processed {
172172
self.0.description()
173173
}
174174

175+
#[allow(unknown_lints, unused_doc_comment)]
175176
fn cause(&self) -> Option<&::std::error::Error> {
176177
match self.1.next_error {
177178
Some(ref c) => Some(&**c),
@@ -423,6 +424,7 @@ macro_rules! impl_extract_backtrace {
423424
($error_name: ident
424425
$error_kind_name: ident
425426
$([$link_error_path: path, $(#[$meta_links: meta])*])*) => {
427+
#[allow(unknown_lints, unused_doc_comment)]
426428
fn extract_backtrace(e: &(::std::error::Error + Send + 'static))
427429
-> Option<::std::sync::Arc<$crate::Backtrace>> {
428430
if let Some(e) = e.downcast_ref::<$error_name>() {

0 commit comments

Comments
 (0)