fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0308]: `if` and `else` have incompatible types 2 --> $DIR/if-then-neeing-semi.rs:28:9 3 | 4LL | let _ = if true { 5 | _____________- 6LL | | 7LL | | async_dummy(); 8 | | -------------- expected because of this 9LL | | 10LL | | } else { 11LL | | async_dummy() 12 | | ^^^^^^^^^^^^^ expected `()`, found future 13... | 14LL | | 15LL | | }; 16 | |_____- `if` and `else` have incompatible types 17 | 18note: calling an async function returns a future 19 --> $DIR/if-then-neeing-semi.rs:28:9 20 | 21LL | async_dummy() 22 | ^^^^^^^^^^^^^ 23help: consider `await`ing on the `Future` 24 | 25LL | async_dummy().await 26 | ++++++ 27help: consider removing this semicolon 28 | 29LL - async_dummy(); 30LL + async_dummy() 31 | 32 33error[E0308]: `if` and `else` have incompatible types 34 --> $DIR/if-then-neeing-semi.rs:41:9 35 | 36LL | let _ = if true { 37 | _____________- 38LL | | 39LL | | async_dummy(); 40 | | -------------- expected because of this 41LL | | 42LL | | } else { 43LL | | async_dummy2() 44 | | ^^^^^^^^^^^^^^ expected `()`, found future 45... | 46LL | | 47LL | | }; 48 | |_____- `if` and `else` have incompatible types 49 | 50note: calling an async function returns a future 51 --> $DIR/if-then-neeing-semi.rs:41:9 52 | 53LL | async_dummy2() 54 | ^^^^^^^^^^^^^^ 55help: consider `await`ing on the `Future` 56 | 57LL | async_dummy2().await 58 | ++++++ 59help: consider removing this semicolon and boxing the expressions 60 | 61LL ~ Box::new(async_dummy()) 62LL | 63LL | } else { 64LL ~ Box::new(async_dummy2()) 65 | 66 67error[E0308]: `if` and `else` have incompatible types 68 --> $DIR/if-then-neeing-semi.rs:54:9 69 | 70LL | let _ = if true { 71 | _____________- 72LL | | 73LL | | async_dummy() 74 | | ------------- expected because of this 75LL | | 76LL | | } else { 77LL | | async_dummy2() 78 | | ^^^^^^^^^^^^^^ expected future, found a different future 79LL | | 80LL | | 81LL | | }; 82 | |_____- `if` and `else` have incompatible types 83 | 84 = note: distinct uses of `impl Trait` result in different opaque types 85help: consider `await`ing on both `Future`s 86 | 87LL ~ async_dummy().await 88LL | 89LL | } else { 90LL ~ async_dummy2().await 91 | 92 93error[E0308]: `if` and `else` have incompatible types 94 --> $DIR/if-then-neeing-semi.rs:13:9 95 | 96LL | let _ = if true { 97 | _____________- 98LL | | 99LL | | dummy(); 100 | | -------- 101 | | | | 102 | | | help: consider removing this semicolon 103 | | expected because of this 104LL | | 105LL | | } else { 106LL | | dummy() 107 | | ^^^^^^^ expected `()`, found `i32` 108LL | | 109LL | | }; 110 | |_____- `if` and `else` have incompatible types 111 112error: aborting due to 4 previous errors 113 114For more information about this error, try `rustc --explain E0308`.