-
-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from dtolnay/frombacktrace
Fix miscounting fields when from and backtrace are same field
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// https://github.com/dtolnay/thiserror/issues/163 | ||
|
||
#![feature(backtrace)] | ||
|
||
use std::backtrace::Backtrace; | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Debug)] | ||
#[error("...")] | ||
pub struct Error(#[from] #[backtrace] std::io::Error, Backtrace); | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: deriving From requires no fields other than source and backtrace | ||
--> tests/ui/from-backtrace-backtrace.rs:10:18 | ||
| | ||
10 | pub struct Error(#[from] #[backtrace] std::io::Error, Backtrace); | ||
| ^^^^^^^ |