]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/trait-upcasting/invalid-upcast.stderr
Rollup merge of #106714 - Ezrashaw:remove-e0490, r=davidtwco
[rust.git] / tests / ui / traits / trait-upcasting / invalid-upcast.stderr
1 error[E0308]: mismatched types
2   --> $DIR/invalid-upcast.rs:53:35
3    |
4 LL |     let _: &dyn std::fmt::Debug = baz;
5    |            --------------------   ^^^ expected trait `Debug`, found trait `Baz`
6    |            |
7    |            expected due to this
8    |
9    = note: expected reference `&dyn Debug`
10               found reference `&dyn Baz`
11
12 error[E0308]: mismatched types
13   --> $DIR/invalid-upcast.rs:55:24
14    |
15 LL |     let _: &dyn Send = baz;
16    |            ---------   ^^^ expected trait `Send`, found trait `Baz`
17    |            |
18    |            expected due to this
19    |
20    = note: expected reference `&dyn Send`
21               found reference `&dyn Baz`
22
23 error[E0308]: mismatched types
24   --> $DIR/invalid-upcast.rs:57:24
25    |
26 LL |     let _: &dyn Sync = baz;
27    |            ---------   ^^^ expected trait `Sync`, found trait `Baz`
28    |            |
29    |            expected due to this
30    |
31    = note: expected reference `&dyn Sync`
32               found reference `&dyn Baz`
33
34 error[E0308]: mismatched types
35   --> $DIR/invalid-upcast.rs:60:25
36    |
37 LL |     let bar: &dyn Bar = baz;
38    |              --------   ^^^ expected trait `Bar`, found trait `Baz`
39    |              |
40    |              expected due to this
41    |
42    = note: expected reference `&dyn Bar`
43               found reference `&dyn Baz`
44
45 error[E0308]: mismatched types
46   --> $DIR/invalid-upcast.rs:62:35
47    |
48 LL |     let _: &dyn std::fmt::Debug = bar;
49    |            --------------------   ^^^ expected trait `Debug`, found trait `Bar`
50    |            |
51    |            expected due to this
52    |
53    = note: expected reference `&dyn Debug`
54               found reference `&dyn Bar`
55
56 error[E0308]: mismatched types
57   --> $DIR/invalid-upcast.rs:64:24
58    |
59 LL |     let _: &dyn Send = bar;
60    |            ---------   ^^^ expected trait `Send`, found trait `Bar`
61    |            |
62    |            expected due to this
63    |
64    = note: expected reference `&dyn Send`
65               found reference `&dyn Bar`
66
67 error[E0308]: mismatched types
68   --> $DIR/invalid-upcast.rs:66:24
69    |
70 LL |     let _: &dyn Sync = bar;
71    |            ---------   ^^^ expected trait `Sync`, found trait `Bar`
72    |            |
73    |            expected due to this
74    |
75    = note: expected reference `&dyn Sync`
76               found reference `&dyn Bar`
77
78 error[E0308]: mismatched types
79   --> $DIR/invalid-upcast.rs:69:25
80    |
81 LL |     let foo: &dyn Foo = baz;
82    |              --------   ^^^ expected trait `Foo`, found trait `Baz`
83    |              |
84    |              expected due to this
85    |
86    = note: expected reference `&dyn Foo`
87               found reference `&dyn Baz`
88
89 error[E0308]: mismatched types
90   --> $DIR/invalid-upcast.rs:71:35
91    |
92 LL |     let _: &dyn std::fmt::Debug = foo;
93    |            --------------------   ^^^ expected trait `Debug`, found trait `Foo`
94    |            |
95    |            expected due to this
96    |
97    = note: expected reference `&dyn Debug`
98               found reference `&dyn Foo`
99
100 error[E0308]: mismatched types
101   --> $DIR/invalid-upcast.rs:73:24
102    |
103 LL |     let _: &dyn Send = foo;
104    |            ---------   ^^^ expected trait `Send`, found trait `Foo`
105    |            |
106    |            expected due to this
107    |
108    = note: expected reference `&dyn Send`
109               found reference `&dyn Foo`
110
111 error[E0308]: mismatched types
112   --> $DIR/invalid-upcast.rs:75:24
113    |
114 LL |     let _: &dyn Sync = foo;
115    |            ---------   ^^^ expected trait `Sync`, found trait `Foo`
116    |            |
117    |            expected due to this
118    |
119    = note: expected reference `&dyn Sync`
120               found reference `&dyn Foo`
121
122 error[E0308]: mismatched types
123   --> $DIR/invalid-upcast.rs:78:25
124    |
125 LL |     let foo: &dyn Foo = bar;
126    |              --------   ^^^ expected trait `Foo`, found trait `Bar`
127    |              |
128    |              expected due to this
129    |
130    = note: expected reference `&dyn Foo`
131               found reference `&dyn Bar`
132
133 error[E0308]: mismatched types
134   --> $DIR/invalid-upcast.rs:80:35
135    |
136 LL |     let _: &dyn std::fmt::Debug = foo;
137    |            --------------------   ^^^ expected trait `Debug`, found trait `Foo`
138    |            |
139    |            expected due to this
140    |
141    = note: expected reference `&dyn Debug`
142               found reference `&dyn Foo`
143
144 error[E0308]: mismatched types
145   --> $DIR/invalid-upcast.rs:82:24
146    |
147 LL |     let _: &dyn Send = foo;
148    |            ---------   ^^^ expected trait `Send`, found trait `Foo`
149    |            |
150    |            expected due to this
151    |
152    = note: expected reference `&dyn Send`
153               found reference `&dyn Foo`
154
155 error[E0308]: mismatched types
156   --> $DIR/invalid-upcast.rs:84:24
157    |
158 LL |     let _: &dyn Sync = foo;
159    |            ---------   ^^^ expected trait `Sync`, found trait `Foo`
160    |            |
161    |            expected due to this
162    |
163    = note: expected reference `&dyn Sync`
164               found reference `&dyn Foo`
165
166 error: aborting due to 15 previous errors
167
168 For more information about this error, try `rustc --explain E0308`.