Ui test changes for trybuild 1.0.49

This commit is contained in:
David Tolnay 2021-10-08 03:02:01 -04:00
parent 035abbd652
commit 00956f1f8c
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
21 changed files with 22 additions and 22 deletions

View File

@ -18,7 +18,7 @@ thiserror-impl = { version = "=1.0.29", path = "impl" }
anyhow = "1.0"
ref-cast = "1.0"
rustversion = "1.0"
trybuild = { version = "1.0.19", features = ["diff"] }
trybuild = { version = "1.0.49", features = ["diff"] }
[workspace]
members = ["impl"]

View File

@ -1,5 +1,5 @@
error: #[error(transparent)] needs to go outside the enum or struct, not on an individual field
--> $DIR/tests/ui/bad-field-attr.rs:5:18
--> tests/ui/bad-field-attr.rs:5:18
|
5 | pub struct Error(#[error(transparent)] std::io::Error);
| ^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: expected string literal
--> $DIR/tests/ui/concat-display.rs:8:17
--> tests/ui/concat-display.rs:8:17
|
8 | #[error(concat!("invalid ", $what))]
| ^^^^^^

View File

@ -1,5 +1,5 @@
error: duplicate #[source] attribute
--> $DIR/tests/ui/duplicate-enum-source.rs:8:9
--> tests/ui/duplicate-enum-source.rs:8:9
|
8 | #[source]
| ^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: only one #[error(...)] attribute is allowed
--> $DIR/tests/ui/duplicate-fmt.rs:5:1
--> tests/ui/duplicate-fmt.rs:5:1
|
5 | #[error("...")]
| ^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: duplicate #[source] attribute
--> $DIR/tests/ui/duplicate-struct-source.rs:7:5
--> tests/ui/duplicate-struct-source.rs:7:5
|
7 | #[source]
| ^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: duplicate #[error(transparent)] attribute
--> $DIR/tests/ui/duplicate-transparent.rs:5:1
--> tests/ui/duplicate-transparent.rs:5:1
|
5 | #[error(transparent)]
| ^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: #[from] is only supported on the source field, not any other field
--> $DIR/tests/ui/from-not-source.rs:7:5
--> tests/ui/from-not-source.rs:7:5
|
7 | #[from]
| ^^^^^^^

View File

@ -1,11 +1,11 @@
error: non-static lifetimes are not allowed in the source of an error, because std::error::Error requires the source is dyn Error + 'static
--> $DIR/tests/ui/lifetime.rs:6:26
--> tests/ui/lifetime.rs:6:26
|
6 | struct Error<'a>(#[from] Inner<'a>);
| ^^^^^^^^^
error: non-static lifetimes are not allowed in the source of an error, because std::error::Error requires the source is dyn Error + 'static
--> $DIR/tests/ui/lifetime.rs:15:17
--> tests/ui/lifetime.rs:15:17
|
15 | Foo(#[from] Generic<&'a str>),
| ^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: missing #[error("...")] display attribute
--> $DIR/tests/ui/missing-fmt.rs:7:5
--> tests/ui/missing-fmt.rs:7:5
|
7 | B(usize),
| ^^^^^^^^

View File

@ -1,5 +1,5 @@
error[E0599]: the method `as_display` exists for reference `&NoDisplay`, but its trait bounds were not satisfied
--> $DIR/tests/ui/no-display.rs:7:9
--> tests/ui/no-display.rs:7:9
|
4 | struct NoDisplay;
| ----------------- doesn't satisfy `NoDisplay: std::fmt::Display`

View File

@ -1,5 +1,5 @@
error[E0599]: the method `as_dyn_error` exists for reference `&NotError`, but its trait bounds were not satisfied
--> $DIR/tests/ui/source-enum-not-error.rs:10:9
--> tests/ui/source-enum-not-error.rs:10:9
|
4 | pub struct NotError;
| --------------------

View File

@ -1,5 +1,5 @@
error[E0599]: the method `as_dyn_error` exists for struct `NotError`, but its trait bounds were not satisfied
--> $DIR/tests/ui/source-struct-not-error.rs:9:5
--> tests/ui/source-struct-not-error.rs:9:5
|
4 | struct NotError;
| ----------------

View File

@ -1,5 +1,5 @@
error: cannot have both #[error(transparent)] and a display attribute
--> $DIR/tests/ui/transparent-display.rs:5:1
--> tests/ui/transparent-display.rs:5:1
|
5 | #[error("...")]
| ^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: #[error(transparent)] requires exactly one field
--> $DIR/tests/ui/transparent-enum-many.rs:5:5
--> tests/ui/transparent-enum-many.rs:5:5
|
5 | / #[error(transparent)]
6 | | Other(anyhow::Error, String),

View File

@ -1,5 +1,5 @@
error: transparent variant can't contain #[source]
--> $DIR/tests/ui/transparent-enum-source.rs:6:11
--> tests/ui/transparent-enum-source.rs:6:11
|
6 | Other(#[source] anyhow::Error),
| ^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: #[error(transparent)] requires exactly one field
--> $DIR/tests/ui/transparent-struct-many.rs:4:1
--> tests/ui/transparent-struct-many.rs:4:1
|
4 | #[error(transparent)]
| ^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: transparent error struct can't contain #[source]
--> $DIR/tests/ui/transparent-struct-source.rs:5:18
--> tests/ui/transparent-struct-source.rs:5:18
|
5 | pub struct Error(#[source] anyhow::Error);
| ^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: not expected here; the #[error(...)] attribute belongs on top of a struct or an enum variant
--> $DIR/tests/ui/unexpected-field-fmt.rs:6:9
--> tests/ui/unexpected-field-fmt.rs:6:9
|
6 | #[error("...")]
| ^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: not expected here; the #[source] attribute belongs on a specific field
--> $DIR/tests/ui/unexpected-struct-source.rs:4:1
--> tests/ui/unexpected-struct-source.rs:4:1
|
4 | #[source]
| ^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: union as errors are not supported
--> $DIR/tests/ui/union.rs:4:1
--> tests/ui/union.rs:4:1
|
4 | / pub union U {
5 | | msg: &'static str,