]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/issue-84976.rs
Rollup merge of #89945 - JohnTitor:we-now-specialize-clone-from-slice, r=the8472
[rust.git] / src / test / ui / mismatched_types / issue-84976.rs
1 /* Checks whether primitive type names are formatted correctly in the
2  * error messages about mismatched types (#84976).
3  */
4
5 fn foo(length: &u32) -> i32 {
6     0
7 }
8
9 fn bar(length: &f32) -> f64 {
10     0.0
11 }
12
13 fn main() {
14     let mut length = 0;
15     length = { foo(&length) };
16     //~^ ERROR mismatched types [E0308]
17     length = foo(&length);
18     //~^ ERROR mismatched types [E0308]
19
20     let mut float_length = 0.0;
21     float_length = { bar(&float_length) };
22     //~^ ERROR mismatched types [E0308]
23     float_length = bar(&float_length);
24     //~^ ERROR mismatched types [E0308]
25 }