fork/rust

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

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

master
2.5 KiB93 linesraw
1error: expected a trait, found type
2  --> $DIR/issue-106694.rs:3:16
3   |
4LL | fn foo(_: impl &Trait) {}
5   |                ^^^^^^
6   |
7help: consider removing the indirection
8   |
9LL - fn foo(_: impl &Trait) {}
10LL + fn foo(_: impl Trait) {}
11   |
12
13error: expected a trait, found type
14  --> $DIR/issue-106694.rs:6:11
15   |
16LL | fn bar<T: &Trait>(_: T) {}
17   |           ^^^^^^
18   |
19help: consider removing the indirection
20   |
21LL - fn bar<T: &Trait>(_: T) {}
22LL + fn bar<T: Trait>(_: T) {}
23   |
24
25error: expected a trait, found type
26  --> $DIR/issue-106694.rs:9:35
27   |
28LL | fn partially_correct_impl(_: impl &*const &Trait + Copy) {}
29   |                                   ^^^^^^^^^^^^^^
30   |
31help: consider removing the indirection
32   |
33LL - fn partially_correct_impl(_: impl &*const &Trait + Copy) {}
34LL + fn partially_correct_impl(_: impl Trait + Copy) {}
35   |
36
37error: expected a trait, found type
38  --> $DIR/issue-106694.rs:12:20
39   |
40LL | fn foo_bad(_: impl &BadTrait) {}
41   |                    ^^^^^^^^^
42   |
43help: consider removing the indirection
44   |
45LL - fn foo_bad(_: impl &BadTrait) {}
46LL + fn foo_bad(_: impl BadTrait) {}
47   |
48
49error: expected a trait, found type
50  --> $DIR/issue-106694.rs:16:15
51   |
52LL | fn bar_bad<T: &BadTrait>(_: T) {}
53   |               ^^^^^^^^^
54   |
55help: consider removing the indirection
56   |
57LL - fn bar_bad<T: &BadTrait>(_: T) {}
58LL + fn bar_bad<T: BadTrait>(_: T) {}
59   |
60
61error: expected a trait, found type
62  --> $DIR/issue-106694.rs:20:39
63   |
64LL | fn partially_correct_impl_bad(_: impl &*const &BadTrait + Copy) {}
65   |                                       ^^^^^^^^^^^^^^^^^
66   |
67help: consider removing the indirection
68   |
69LL - fn partially_correct_impl_bad(_: impl &*const &BadTrait + Copy) {}
70LL + fn partially_correct_impl_bad(_: impl BadTrait + Copy) {}
71   |
72
73error[E0405]: cannot find trait `BadTrait` in this scope
74  --> $DIR/issue-106694.rs:12:21
75   |
76LL | fn foo_bad(_: impl &BadTrait) {}
77   |                     ^^^^^^^^ not found in this scope
78
79error[E0405]: cannot find trait `BadTrait` in this scope
80  --> $DIR/issue-106694.rs:16:16
81   |
82LL | fn bar_bad<T: &BadTrait>(_: T) {}
83   |                ^^^^^^^^ not found in this scope
84
85error[E0405]: cannot find trait `BadTrait` in this scope
86  --> $DIR/issue-106694.rs:20:48
87   |
88LL | fn partially_correct_impl_bad(_: impl &*const &BadTrait + Copy) {}
89   |                                                ^^^^^^^^ not found in this scope
90
91error: aborting due to 9 previous errors
92
93For more information about this error, try `rustc --explain E0405`.