summaryrefslogtreecommitdiffstats
path: root/tests/ui/type/type-check/issue-116967-cannot-coerce-returned-result.stderr
blob: 3a8d9c71968d7c532a9b52248d3c23368614028c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
error[E0308]: mismatched types
  --> $DIR/issue-116967-cannot-coerce-returned-result.rs:3:5
   |
LL | fn foo() -> Result<String, ()> {
   |             ------------------ expected `Result<String, ()>` because of return type
LL |     let out: Result<(), ()> = Ok(());
LL |     out
   |     ^^^ expected `Result<String, ()>`, found `Result<(), ()>`
   |
   = note: expected enum `Result<String, _>`
              found enum `Result<(), _>`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0308`.