]> git.lizzy.rs Git - rust.git/blob - tests/ui/mismatched_types/issue-84976.stderr
Rollup merge of #107037 - tmiasko:rank, r=oli-obk
[rust.git] / tests / ui / mismatched_types / issue-84976.stderr
1 error[E0308]: mismatched types
2   --> $DIR/issue-84976.rs:15:16
3    |
4 LL |     length = { foo(&length) };
5    |                ^^^^^^^^^^^^ expected `u32`, found `i32`
6    |
7 help: you can convert an `i32` to a `u32` and panic if the converted value doesn't fit
8    |
9 LL |     length = { foo(&length).try_into().unwrap() };
10    |                            ++++++++++++++++++++
11
12 error[E0308]: mismatched types
13   --> $DIR/issue-84976.rs:17:14
14    |
15 LL |     let mut length = 0;
16    |                      - expected due to this value
17 ...
18 LL |     length = foo(&length);
19    |              ^^^^^^^^^^^^ expected `u32`, found `i32`
20
21 error[E0308]: mismatched types
22   --> $DIR/issue-84976.rs:21:22
23    |
24 LL |     float_length = { bar(&float_length) };
25    |                      ^^^^^^^^^^^^^^^^^^ expected `f32`, found `f64`
26
27 error[E0308]: mismatched types
28   --> $DIR/issue-84976.rs:23:20
29    |
30 LL |     let mut float_length = 0.0;
31    |                            --- expected due to this value
32 ...
33 LL |     float_length = bar(&float_length);
34    |                    ^^^^^^^^^^^^^^^^^^ expected `f32`, found `f64`
35
36 error: aborting due to 4 previous errors
37
38 For more information about this error, try `rustc --explain E0308`.