Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit 955e754

Browse files
authored
Merge pull request #22 from brson/next
Fix a resolve bug
2 parents b9c51a0 + 7c449c0 commit 955e754

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "error-chain"
4-
version = "0.4.0"
4+
version = "0.4.1"
55
authors = [ "Brian Anderson <banderson@mozilla.com>",
66
"Paul Colomiets <paul@colomiets.name>",
77
"Colin Kiegel <kiegel@gmx.de>"]

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,14 +481,14 @@ macro_rules! error_chain {
481481

482482
$(
483483
$link_variant(e: $link_kind_path) {
484-
description(e.description())
484+
description(::std::error::Error::description(e))
485485
display("{}", e)
486486
}
487487
) *
488488

489489
$(
490490
$foreign_link_variant(err: $foreign_link_error_path) {
491-
description(err.description())
491+
description(::std::error::Error::description(err))
492492
display("{}", err)
493493
}
494494
) *

tests/tests.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ fn empty() {
112112
#[cfg(test)]
113113
mod foreign_link_test {
114114

115-
use std::error::Error as StdError;
116115
use std::fmt;
117116

118117
// Note: foreign errors must be `pub` because they appear in the
@@ -122,12 +121,12 @@ mod foreign_link_test {
122121
cause: ForeignErrorCause
123122
}
124123

125-
impl StdError for ForeignError {
124+
impl ::std::error::Error for ForeignError {
126125
fn description(&self) -> &'static str {
127126
"Foreign error description"
128127
}
129128

130-
fn cause(&self) -> Option<&StdError> { Some(&self.cause) }
129+
fn cause(&self) -> Option<&::std::error::Error> { Some(&self.cause) }
131130
}
132131

133132
impl fmt::Display for ForeignError {
@@ -139,12 +138,12 @@ mod foreign_link_test {
139138
#[derive(Debug)]
140139
pub struct ForeignErrorCause {}
141140

142-
impl StdError for ForeignErrorCause {
141+
impl ::std::error::Error for ForeignErrorCause {
143142
fn description(&self) -> &'static str {
144143
"Foreign error cause description"
145144
}
146145

147-
fn cause(&self) -> Option<&StdError> { None }
146+
fn cause(&self) -> Option<&::std::error::Error> { None }
148147
}
149148

150149
impl fmt::Display for ForeignErrorCause {
@@ -178,7 +177,7 @@ mod foreign_link_test {
178177
let chained_error = try_foreign_error().err().unwrap();
179178
assert_eq!(
180179
format!("{}", ForeignErrorCause{}),
181-
format!("{}", chained_error.cause().unwrap())
180+
format!("{}", ::std::error::Error::cause(&chained_error).unwrap())
182181
);
183182
}
184183

@@ -195,7 +194,7 @@ mod foreign_link_test {
195194
format!("{}", error_iter.next().unwrap())
196195
);
197196
assert_eq!(
198-
format!("{:?}", None as Option<&StdError>),
197+
format!("{:?}", None as Option<&::std::error::Error>),
199198
format!("{:?}", error_iter.next())
200199
);
201200
}

0 commit comments

Comments
 (0)