Skip to content
  • Sponsor
  • Notifications You must be signed in to change notification settings
  • Fork 170

Commit ebebf77

Browse files
committedOct 19, 2023
Format ui tests with rustfmt
`rustfmt tests/ui/*.rs`
1 parent ff0a0a5 commit ebebf77

5 files changed

+30
-29
lines changed
 

‎tests/ui/from-backtrace-backtrace.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ use thiserror::Error;
55

66
#[derive(Error, Debug)]
77
#[error("...")]
8-
pub struct Error(#[from] #[backtrace] std::io::Error, Backtrace);
8+
pub struct Error(
9+
#[from]
10+
#[backtrace]
11+
std::io::Error,
12+
Backtrace,
13+
);
914

1015
fn main() {}
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: deriving From requires no fields other than source and backtrace
2-
--> tests/ui/from-backtrace-backtrace.rs:8:18
2+
--> tests/ui/from-backtrace-backtrace.rs:9:5
33
|
4-
8 | pub struct Error(#[from] #[backtrace] std::io::Error, Backtrace);
5-
| ^^^^^^^
4+
9 | #[from]
5+
| ^^^^^^^

‎tests/ui/source-enum-not-error.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ pub struct NotError;
66
#[derive(Error, Debug)]
77
#[error("...")]
88
pub enum ErrorEnum {
9-
Broken {
10-
source: NotError,
11-
},
9+
Broken { source: NotError },
1210
}
1311

1412
fn main() {}

‎tests/ui/source-enum-not-error.stderr

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
error[E0599]: the method `as_dyn_error` exists for reference `&NotError`, but its trait bounds were not satisfied
2-
--> tests/ui/source-enum-not-error.rs:10:9
3-
|
4-
4 | pub struct NotError;
5-
| -------------------
6-
| |
7-
| doesn't satisfy `NotError: AsDynError<'_>`
8-
| doesn't satisfy `NotError: std::error::Error`
2+
--> tests/ui/source-enum-not-error.rs:9:14
3+
|
4+
4 | pub struct NotError;
5+
| -------------------
6+
| |
7+
| doesn't satisfy `NotError: AsDynError<'_>`
8+
| doesn't satisfy `NotError: std::error::Error`
99
...
10-
10 | source: NotError,
11-
| ^^^^^^ method cannot be called on `&NotError` due to unsatisfied trait bounds
12-
|
13-
= note: the following trait bounds were not satisfied:
14-
`NotError: std::error::Error`
15-
which is required by `NotError: AsDynError<'_>`
16-
`&NotError: std::error::Error`
17-
which is required by `&NotError: AsDynError<'_>`
10+
9 | Broken { source: NotError },
11+
| ^^^^^^ method cannot be called on `&NotError` due to unsatisfied trait bounds
12+
|
13+
= note: the following trait bounds were not satisfied:
14+
`NotError: std::error::Error`
15+
which is required by `NotError: AsDynError<'_>`
16+
`&NotError: std::error::Error`
17+
which is required by `&NotError: AsDynError<'_>`
1818
note: the trait `std::error::Error` must be implemented
19-
--> $RUST/core/src/error.rs
20-
|
21-
| pub trait Error: Debug + Display {
22-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19+
--> $RUST/core/src/error.rs
20+
|
21+
| pub trait Error: Debug + Display {
22+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

‎tests/ui/transparent-enum-not-error.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ use thiserror::Error;
33
#[derive(Error, Debug)]
44
pub enum Error {
55
#[error(transparent)]
6-
Other {
7-
message: String,
8-
}
6+
Other { message: String },
97
}
108

119
fn main() {}

0 commit comments

Comments
 (0)
Please sign in to comment.