]> git.lizzy.rs Git - rust.git/commitdiff
UI test updates for Result and Option method moves
authorDavid Tolnay <dtolnay@gmail.com>
Thu, 30 Dec 2021 19:15:50 +0000 (11:15 -0800)
committerDavid Tolnay <dtolnay@gmail.com>
Thu, 30 Dec 2021 19:15:50 +0000 (11:15 -0800)
src/test/ui/issues/issue-50264-inner-deref-trait/option-as_deref_mut.stderr
src/test/ui/issues/issue-50264-inner-deref-trait/result-as_deref_mut.stderr
src/test/ui/mismatched_types/method-help-unsatisfied-bound.rs
src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr

index e4e9705b07db5e59cf61369e83427b85590f279c..52ee1db5b157113d3a3a1ea2c83582d3ad80b3e8 100644 (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
index 98a7091dd0583c8a0f27efae8e7ecac5483e59e8..018557881ef77edb45ee41dce7eba85273a2c6aa 100644 (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
index f85c10d78c54dda7cc7152a56e332f3ae7f53cb0..6303c6e6a5db11404e1850fbf09dc214c61cfcc4 100644 (file)
@@ -3,5 +3,5 @@
 fn main() {
     let a: Result<(), Foo> = Ok(());
     a.unwrap();
-    //~^ ERROR the method
+    //~^ ERROR `Foo` doesn't implement `Debug`
 }
index 596b7bfe79c5c56ed7d60abd088da1ad98d344e9..dc73bcd6e4d050aa27835b524445d3bdbd85e3dd 100644 (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`.