fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
517 B20 linesraw
1// run-rustfix
2#![allow(unused_variables)]
3
4fn main() {
5    let items = vec![1, 2, 3];
6    let ref_items: &[i32] = &items;
7    let items_clone: Vec<i32> = ref_items.to_vec();
8    //~^ ERROR mismatched types
9
10    // in that case no suggestion will be triggered
11    let items_clone_2: Vec<i32> = items.clone();
12
13    let s = "hi";
14    let string: String = s.to_string();
15    //~^ ERROR mismatched types
16
17    // in that case no suggestion will be triggered
18    let s2 = "hi";
19    let string_2: String = s2.to_string();
20}