UI test updates for Result and Option method moves

This commit is contained in:
David Tolnay 2021-12-30 11:15:50 -08:00
parent dc3291614a
commit 5960f7a617
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
4 changed files with 10 additions and 14 deletions

View File

@ -5,7 +5,6 @@ LL | let _result = &mut Some(42).as_deref_mut();
| ^^^^^^^^^^^^ method cannot be called on `Option<{integer}>` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`{integer}: DerefMut`
`{integer}: Deref`
error: aborting due to previous error

View File

@ -5,7 +5,6 @@ LL | let _result = &mut Ok(42).as_deref_mut();
| ^^^^^^^^^^^^ method cannot be called on `Result<{integer}, _>` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`{integer}: DerefMut`
`{integer}: Deref`
error: aborting due to previous error

View File

@ -3,5 +3,5 @@ struct Foo;
fn main() {
let a: Result<(), Foo> = Ok(());
a.unwrap();
//~^ ERROR the method
//~^ ERROR `Foo` doesn't implement `Debug`
}

View File

@ -1,19 +1,17 @@
error[E0599]: the method `unwrap` exists for enum `Result<(), Foo>`, but its trait bounds were not satisfied
error[E0277]: `Foo` doesn't implement `Debug`
--> $DIR/method-help-unsatisfied-bound.rs:5:7
|
LL | struct Foo;
| ----------- doesn't satisfy `Foo: Debug`
...
LL | a.unwrap();
| ^^^^^^ method cannot be called on `Result<(), Foo>` due to unsatisfied trait bounds
| ^^^^^^ `Foo` cannot be formatted using `{:?}`
|
= note: the following trait bounds were not satisfied:
`Foo: Debug`
help: consider annotating `Foo` with `#[derive(Debug)]`
|
LL | #[derive(Debug)]
= help: the trait `Debug` is not implemented for `Foo`
= note: add `#[derive(Debug)]` to `Foo` or manually `impl Debug for Foo`
note: required by a bound in `Result::<T, E>::unwrap`
--> $SRC_DIR/core/src/result.rs:LL:COL
|
LL | E: fmt::Debug,
| ^^^^^^^^^^ required by this bound in `Result::<T, E>::unwrap`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.
For more information about this error, try `rustc --explain E0277`.