Skip to content

Commit

Permalink
Format ui tests with rustfmt
Browse files Browse the repository at this point in the history
`rustfmt tests/ui/*.rs`
  • Loading branch information
dtolnay committed Oct 19, 2023
1 parent ff0a0a5 commit ebebf77
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 29 deletions.
7 changes: 6 additions & 1 deletion tests/ui/from-backtrace-backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ use thiserror::Error;

#[derive(Error, Debug)]
#[error("...")]
pub struct Error(#[from] #[backtrace] std::io::Error, Backtrace);
pub struct Error(
#[from]
#[backtrace]
std::io::Error,
Backtrace,
);

fn main() {}
6 changes: 3 additions & 3 deletions tests/ui/from-backtrace-backtrace.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: deriving From requires no fields other than source and backtrace
--> tests/ui/from-backtrace-backtrace.rs:8:18
--> tests/ui/from-backtrace-backtrace.rs:9:5
|
8 | pub struct Error(#[from] #[backtrace] std::io::Error, Backtrace);
| ^^^^^^^
9 | #[from]
| ^^^^^^^
4 changes: 1 addition & 3 deletions tests/ui/source-enum-not-error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ pub struct NotError;
#[derive(Error, Debug)]
#[error("...")]
pub enum ErrorEnum {
Broken {
source: NotError,
},
Broken { source: NotError },
}

fn main() {}
38 changes: 19 additions & 19 deletions tests/ui/source-enum-not-error.stderr
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
error[E0599]: the method `as_dyn_error` exists for reference `&NotError`, but its trait bounds were not satisfied
--> tests/ui/source-enum-not-error.rs:10:9
|
4 | pub struct NotError;
| -------------------
| |
| doesn't satisfy `NotError: AsDynError<'_>`
| doesn't satisfy `NotError: std::error::Error`
--> tests/ui/source-enum-not-error.rs:9:14
|
4 | pub struct NotError;
| -------------------
| |
| doesn't satisfy `NotError: AsDynError<'_>`
| doesn't satisfy `NotError: std::error::Error`
...
10 | source: NotError,
| ^^^^^^ method cannot be called on `&NotError` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`NotError: std::error::Error`
which is required by `NotError: AsDynError<'_>`
`&NotError: std::error::Error`
which is required by `&NotError: AsDynError<'_>`
9 | Broken { source: NotError },
| ^^^^^^ method cannot be called on `&NotError` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`NotError: std::error::Error`
which is required by `NotError: AsDynError<'_>`
`&NotError: std::error::Error`
which is required by `&NotError: AsDynError<'_>`
note: the trait `std::error::Error` must be implemented
--> $RUST/core/src/error.rs
|
| pub trait Error: Debug + Display {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--> $RUST/core/src/error.rs
|
| pub trait Error: Debug + Display {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 changes: 1 addition & 3 deletions tests/ui/transparent-enum-not-error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error(transparent)]
Other {
message: String,
}
Other { message: String },
}

fn main() {}

0 comments on commit ebebf77

Please sign in to comment.