]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/suggest-remove-deref.rs
Rollup merge of #107595 - michaelwoerister:retry_proc_macro_loading, r=petrochenkov
[rust.git] / tests / ui / suggestions / suggest-remove-deref.rs
1 // run-rustfix
2
3 //issue #106496
4
5 struct S;
6
7 trait X {}
8 impl X for S {}
9
10 fn foo<T: X>(_: &T) {}
11 fn test_foo() {
12     let hello = &S;
13     foo(*hello);
14     //~^ ERROR mismatched types
15 }
16
17 fn bar(_: &String) {}
18 fn test_bar() {
19     let v = String::from("hello");
20     let s = &v;
21     bar(*s);
22     //~^ ERROR mismatched types
23 }
24
25 fn main() {
26     test_foo();
27     test_bar();
28 }