Skip to content

Add accessors for io::Error's inner Error #25816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 29, 2015

Conversation

sfackler
Copy link
Member

The first commit simply forwards io::Error's cause implementation to the inner error.

The second commit adds accessor methods for the inner error. Method names mirror those used elsewhere like BufReader.

r? @alexcrichton

@alexcrichton
Copy link
Member

This all looks good to me, with downcasting on Error I think that this'll basically be necessary.

Can you add some tests which exercise the downcasting and the various accessors?

sfackler added 3 commits May 27, 2015 21:53
error::Error itself has downcasting methods, so there's no need to
duplicate those here.
Ergonomics are a bit crappy right now because method resolution isn't
smart enough to drop bounds, unfortunately.
@sfackler sfackler force-pushed the io-error-delegation branch from 1695200 to f65ba38 Compare May 28, 2015 06:03
@sfackler
Copy link
Member Author

Updated

@alexcrichton
Copy link
Member

Could you add "requires UFCS to downcast" to one of the reason blocks of the #[unstable] attributes as well? Other than that though r=me, thanks!

@sfackler
Copy link
Member Author

@bors r=alexcrichton aebf331

@bors
Copy link
Collaborator

bors commented May 28, 2015

⌛ Testing commit aebf331 with merge 9befda2...

@bors
Copy link
Collaborator

bors commented May 28, 2015

💔 Test failed - auto-linux-64-nopt-t

@alexcrichton
Copy link
Member

@bors: retry

On Thu, May 28, 2015 at 1:16 PM, bors [email protected] wrote:

[image: 💔] Test failed - auto-linux-64-nopt-t
http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/5101


Reply to this email directly or view it on GitHub
#25816 (comment).

bors added a commit that referenced this pull request May 29, 2015
The first commit simply forwards `io::Error`'s `cause` implementation to the inner error.

The second commit adds accessor methods for the inner error. Method names mirror those used elsewhere like `BufReader`.

r? @alexcrichton
@bors
Copy link
Collaborator

bors commented May 29, 2015

⌛ Testing commit aebf331 with merge 99c2f77...

@bors bors merged commit aebf331 into rust-lang:master May 29, 2015
@sfackler sfackler deleted the io-error-delegation branch November 26, 2016 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants