1 error[E0308]: mismatched types
2 --> $DIR/invalid-upcast.rs:53:35
4 LL | let _: &dyn std::fmt::Debug = baz;
5 | -------------------- ^^^ expected trait `Debug`, found trait `Baz`
9 = note: expected reference `&dyn Debug`
10 found reference `&dyn Baz`
12 error[E0308]: mismatched types
13 --> $DIR/invalid-upcast.rs:55:24
15 LL | let _: &dyn Send = baz;
16 | --------- ^^^ expected trait `Send`, found trait `Baz`
18 | expected due to this
20 = note: expected reference `&dyn Send`
21 found reference `&dyn Baz`
23 error[E0308]: mismatched types
24 --> $DIR/invalid-upcast.rs:57:24
26 LL | let _: &dyn Sync = baz;
27 | --------- ^^^ expected trait `Sync`, found trait `Baz`
29 | expected due to this
31 = note: expected reference `&dyn Sync`
32 found reference `&dyn Baz`
34 error[E0308]: mismatched types
35 --> $DIR/invalid-upcast.rs:60:25
37 LL | let bar: &dyn Bar = baz;
38 | -------- ^^^ expected trait `Bar`, found trait `Baz`
40 | expected due to this
42 = note: expected reference `&dyn Bar`
43 found reference `&dyn Baz`
45 error[E0308]: mismatched types
46 --> $DIR/invalid-upcast.rs:62:35
48 LL | let _: &dyn std::fmt::Debug = bar;
49 | -------------------- ^^^ expected trait `Debug`, found trait `Bar`
51 | expected due to this
53 = note: expected reference `&dyn Debug`
54 found reference `&dyn Bar`
56 error[E0308]: mismatched types
57 --> $DIR/invalid-upcast.rs:64:24
59 LL | let _: &dyn Send = bar;
60 | --------- ^^^ expected trait `Send`, found trait `Bar`
62 | expected due to this
64 = note: expected reference `&dyn Send`
65 found reference `&dyn Bar`
67 error[E0308]: mismatched types
68 --> $DIR/invalid-upcast.rs:66:24
70 LL | let _: &dyn Sync = bar;
71 | --------- ^^^ expected trait `Sync`, found trait `Bar`
73 | expected due to this
75 = note: expected reference `&dyn Sync`
76 found reference `&dyn Bar`
78 error[E0308]: mismatched types
79 --> $DIR/invalid-upcast.rs:69:25
81 LL | let foo: &dyn Foo = baz;
82 | -------- ^^^ expected trait `Foo`, found trait `Baz`
84 | expected due to this
86 = note: expected reference `&dyn Foo`
87 found reference `&dyn Baz`
89 error[E0308]: mismatched types
90 --> $DIR/invalid-upcast.rs:71:35
92 LL | let _: &dyn std::fmt::Debug = foo;
93 | -------------------- ^^^ expected trait `Debug`, found trait `Foo`
95 | expected due to this
97 = note: expected reference `&dyn Debug`
98 found reference `&dyn Foo`
100 error[E0308]: mismatched types
101 --> $DIR/invalid-upcast.rs:73:24
103 LL | let _: &dyn Send = foo;
104 | --------- ^^^ expected trait `Send`, found trait `Foo`
106 | expected due to this
108 = note: expected reference `&dyn Send`
109 found reference `&dyn Foo`
111 error[E0308]: mismatched types
112 --> $DIR/invalid-upcast.rs:75:24
114 LL | let _: &dyn Sync = foo;
115 | --------- ^^^ expected trait `Sync`, found trait `Foo`
117 | expected due to this
119 = note: expected reference `&dyn Sync`
120 found reference `&dyn Foo`
122 error[E0308]: mismatched types
123 --> $DIR/invalid-upcast.rs:78:25
125 LL | let foo: &dyn Foo = bar;
126 | -------- ^^^ expected trait `Foo`, found trait `Bar`
128 | expected due to this
130 = note: expected reference `&dyn Foo`
131 found reference `&dyn Bar`
133 error[E0308]: mismatched types
134 --> $DIR/invalid-upcast.rs:80:35
136 LL | let _: &dyn std::fmt::Debug = foo;
137 | -------------------- ^^^ expected trait `Debug`, found trait `Foo`
139 | expected due to this
141 = note: expected reference `&dyn Debug`
142 found reference `&dyn Foo`
144 error[E0308]: mismatched types
145 --> $DIR/invalid-upcast.rs:82:24
147 LL | let _: &dyn Send = foo;
148 | --------- ^^^ expected trait `Send`, found trait `Foo`
150 | expected due to this
152 = note: expected reference `&dyn Send`
153 found reference `&dyn Foo`
155 error[E0308]: mismatched types
156 --> $DIR/invalid-upcast.rs:84:24
158 LL | let _: &dyn Sync = foo;
159 | --------- ^^^ expected trait `Sync`, found trait `Foo`
161 | expected due to this
163 = note: expected reference `&dyn Sync`
164 found reference `&dyn Foo`
166 error: aborting due to 15 previous errors
168 For more information about this error, try `rustc --explain E0308`.