Change ui tests to work whether or not rust-src is installed
This commit is contained in:
parent
663d835689
commit
04b91d7646
|
@ -1,9 +0,0 @@
|
||||||
use thiserror::Error;
|
|
||||||
|
|
||||||
#[derive(Error, Debug)]
|
|
||||||
pub enum MyError {
|
|
||||||
First,
|
|
||||||
Second,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {}
|
|
|
@ -1,8 +0,0 @@
|
||||||
error[E0277]: `MyError` doesn't implement `std::fmt::Display`
|
|
||||||
--> $DIR/missing-display.rs:4:1
|
|
||||||
|
|
|
||||||
4 | pub enum MyError {
|
|
||||||
| ^^^^^^^^^^^^^^^^ `MyError` cannot be formatted with the default formatter
|
|
||||||
|
|
|
||||||
= help: the trait `std::fmt::Display` is not implemented for `MyError`
|
|
||||||
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
|
|
|
@ -1,10 +1,12 @@
|
||||||
use std::thread::Thread;
|
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
struct NoDisplay;
|
||||||
|
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug)]
|
||||||
#[error("thread: {thread}")]
|
#[error("thread: {thread}")]
|
||||||
pub struct Error {
|
pub struct Error {
|
||||||
thread: Thread,
|
thread: NoDisplay,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
error[E0599]: no method named `as_display` found for reference `&Thread` in the current scope
|
error[E0599]: no method named `as_display` found for reference `&NoDisplay` in the current scope
|
||||||
--> $DIR/no-display.rs:5:9
|
--> $DIR/no-display.rs:7:9
|
||||||
|
|
|
|
||||||
5 | #[error("thread: {thread}")]
|
4 | struct NoDisplay;
|
||||||
| ^^^^^^^^^^^^^^^^^^ method not found in `&Thread`
|
| ----------------- doesn't satisfy `NoDisplay: std::fmt::Display`
|
||||||
|
...
|
||||||
|
7 | #[error("thread: {thread}")]
|
||||||
|
| ^^^^^^^^^^^^^^^^^^ method not found in `&NoDisplay`
|
||||||
|
|
|
|
||||||
= note: the method `as_display` exists but the following trait bounds were not satisfied:
|
= note: the method `as_display` exists but the following trait bounds were not satisfied:
|
||||||
`Thread: std::fmt::Display`
|
`NoDisplay: std::fmt::Display`
|
||||||
which is required by `&Thread: DisplayAsDisplay`
|
which is required by `&NoDisplay: DisplayAsDisplay`
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct NotError;
|
||||||
|
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug)]
|
||||||
#[error("...")]
|
#[error("...")]
|
||||||
pub enum ErrorEnum {
|
pub enum ErrorEnum {
|
||||||
Broken {
|
Broken {
|
||||||
source: String,
|
source: NotError,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
error[E0599]: no method named `as_dyn_error` found for reference `&String` in the current scope
|
error[E0599]: no method named `as_dyn_error` found for reference `&NotError` in the current scope
|
||||||
--> $DIR/source-enum-not-error.rs:7:9
|
--> $DIR/source-enum-not-error.rs:10:9
|
||||||
|
|
|
|
||||||
7 | source: String,
|
4 | pub struct NotError;
|
||||||
| ^^^^^^ method not found in `&String`
|
| --------------------
|
||||||
|
| |
|
||||||
|
| doesn't satisfy `NotError: AsDynError`
|
||||||
|
| doesn't satisfy `NotError: std::error::Error`
|
||||||
|
...
|
||||||
|
10 | source: NotError,
|
||||||
|
| ^^^^^^ method not found in `&NotError`
|
||||||
|
|
|
|
||||||
= note: the method `as_dyn_error` exists but the following trait bounds were not satisfied:
|
= note: the method `as_dyn_error` exists but the following trait bounds were not satisfied:
|
||||||
`String: std::error::Error`
|
`NotError: std::error::Error`
|
||||||
which is required by `String: AsDynError`
|
which is required by `NotError: AsDynError`
|
||||||
`&String: std::error::Error`
|
`&NotError: std::error::Error`
|
||||||
which is required by `&String: AsDynError`
|
which is required by `&NotError: AsDynError`
|
||||||
`str: Sized`
|
|
||||||
which is required by `str: AsDynError`
|
|
||||||
`str: std::error::Error`
|
|
||||||
which is required by `str: AsDynError`
|
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
struct NotError;
|
||||||
|
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug)]
|
||||||
#[error("...")]
|
#[error("...")]
|
||||||
pub struct ErrorStruct {
|
pub struct ErrorStruct {
|
||||||
source: String,
|
source: NotError,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
error[E0599]: no method named `as_dyn_error` found for struct `String` in the current scope
|
error[E0599]: no method named `as_dyn_error` found for struct `NotError` in the current scope
|
||||||
--> $DIR/source-struct-not-error.rs:6:5
|
--> $DIR/source-struct-not-error.rs:9:5
|
||||||
|
|
|
|
||||||
6 | source: String,
|
4 | struct NotError;
|
||||||
| ^^^^^^ method not found in `String`
|
| ----------------
|
||||||
|
| |
|
||||||
|
| method `as_dyn_error` not found for this
|
||||||
|
| doesn't satisfy `NotError: AsDynError`
|
||||||
|
| doesn't satisfy `NotError: std::error::Error`
|
||||||
|
...
|
||||||
|
9 | source: NotError,
|
||||||
|
| ^^^^^^ method not found in `NotError`
|
||||||
|
|
|
|
||||||
= note: the method `as_dyn_error` exists but the following trait bounds were not satisfied:
|
= note: the method `as_dyn_error` exists but the following trait bounds were not satisfied:
|
||||||
`String: std::error::Error`
|
`NotError: std::error::Error`
|
||||||
which is required by `String: AsDynError`
|
which is required by `NotError: AsDynError`
|
||||||
`str: Sized`
|
|
||||||
which is required by `str: AsDynError`
|
|
||||||
`str: std::error::Error`
|
|
||||||
which is required by `str: AsDynError`
|
|
||||||
|
|
Loading…
Reference in New Issue