]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/issue-53692.rs
Rollup merge of #107632 - ameknite:issue-107622-fix, r=jyn514
[rust.git] / tests / ui / suggestions / issue-53692.rs
1 // run-rustfix
2 #![allow(unused_variables)]
3
4 fn main() {
5     let items = vec![1, 2, 3];
6     let ref_items: &[i32] = &items;
7     let items_clone: Vec<i32> = ref_items.clone();
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.clone();
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 }