You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
note: for a trait to be dyn compatible it needs to allow building a vtable
34
-
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
= note: see issue #133119 <https://github.com/rust-lang/rust/issues/133119> for more information
8
8
= note: `#[warn(incomplete_features)]` on by default
9
9
10
-
error[E0038]: the trait `AsyncTrait` is not dyn compatible
11
-
--> $DIR/works.rs:27:34
12
-
|
13
-
LL | let x: &dyn AsyncTrait = &"hello, world!";
14
-
| ^^^^^^^^^^^^^^^^ `AsyncTrait` is not dyn compatible
15
-
|
16
-
note: for a trait to be dyn compatible it needs to allow building a vtable
17
-
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
18
-
--> $DIR/works.rs:14:14
19
-
|
20
-
LL | trait AsyncTrait {
21
-
| ---------- this trait is not dyn compatible...
22
-
LL | async fn async_dispatch(&self);
23
-
| ^^^^^^^^^^^^^^ ...because method `async_dispatch` is `async`
24
-
= help: consider moving `async_dispatch` to another trait
25
-
= help: only type `&'static str` implements `AsyncTrait`; consider using it directly instead.
26
-
= note: required for the cast from `&&'static str` to `&dyn AsyncTrait`
27
-
28
10
error[E0038]: the trait `AsyncTrait` is not dyn compatible
= note: see issue #133119 <https://github.com/rust-lang/rust/issues/133119> for more information
8
8
= note: `#[warn(incomplete_features)]` on by default
9
9
10
-
error[E0038]: the trait `AsyncTrait` is not dyn compatible
11
-
--> $DIR/wrong-size.rs:21:30
12
-
|
13
-
LL | let x: &dyn AsyncTrait = &"hello, world!";
14
-
| ^^^^^^^^^^^^^^^^ `AsyncTrait` is not dyn compatible
15
-
|
16
-
note: for a trait to be dyn compatible it needs to allow building a vtable
17
-
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
18
-
--> $DIR/wrong-size.rs:9:14
19
-
|
20
-
LL | trait AsyncTrait {
21
-
| ---------- this trait is not dyn compatible...
22
-
LL | async fn async_dispatch(&self);
23
-
| ^^^^^^^^^^^^^^ ...because method `async_dispatch` is `async`
24
-
= help: consider moving `async_dispatch` to another trait
25
-
= help: only type `&'static str` implements `AsyncTrait`; consider using it directly instead.
26
-
= note: required for the cast from `&&'static str` to `&dyn AsyncTrait`
27
-
28
10
error[E0038]: the trait `AsyncTrait` is not dyn compatible
note: for a trait to be dyn compatible it needs to allow building a vtable
8
8
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
note: for a trait to be dyn compatible it needs to allow building a vtable
25
25
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...because method `transmute` references the `Self` type in its return type
33
33
= help: consider moving `transmute` to another trait
34
34
35
-
error[E0038]: the trait `Foo` is not dyn compatible
36
-
--> $DIR/almost-supertrait-associated-type.rs:7:6
37
-
|
38
-
LL | (&PhantomData::<T> as &dyn Foo<T, U>).transmute(t)
39
-
| ^^^^^^^^^^^^^^^^^ `Foo` is not dyn compatible
40
-
|
41
-
note: for a trait to be dyn compatible it needs to allow building a vtable
42
-
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
Copy file name to clipboardExpand all lines: tests/ui/dyn-compatibility/associated-consts.stderr
+1-18Lines changed: 1 addition & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -14,23 +14,6 @@ LL | const X: usize;
14
14
| ^ ...because it contains this associated `const`
15
15
= help: consider moving `X` to another trait
16
16
17
-
error[E0038]: the trait `Bar` is not dyn compatible
18
-
--> $DIR/associated-consts.rs:10:5
19
-
|
20
-
LL | t
21
-
| ^ `Bar` is not dyn compatible
22
-
|
23
-
note: for a trait to be dyn compatible it needs to allow building a vtable
24
-
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
25
-
--> $DIR/associated-consts.rs:5:11
26
-
|
27
-
LL | trait Bar {
28
-
| --- this trait is not dyn compatible...
29
-
LL | const X: usize;
30
-
| ^ ...because it contains this associated `const`
31
-
= help: consider moving `X` to another trait
32
-
= note: required for the cast from `&T` to `&dyn Bar`
33
-
34
-
error: aborting due to 2 previous errors
17
+
error: aborting due to 1 previous error
35
18
36
19
For more information about this error, try `rustc --explain E0038`.
Copy file name to clipboardExpand all lines: tests/ui/dyn-compatibility/generics.stderr
+3-37Lines changed: 3 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ LL | fn bar<T>(&self, t: T);
15
15
= help: consider moving `bar` to another trait
16
16
17
17
error[E0038]: the trait `Bar` is not dyn compatible
18
-
--> $DIR/generics.rs:21:40
18
+
--> $DIR/generics.rs:20:40
19
19
|
20
20
LL | fn make_bar_explicit<T:Bar>(t: &T) -> &dyn Bar {
21
21
| ^^^^^^^ `Bar` is not dyn compatible
@@ -31,24 +31,7 @@ LL | fn bar<T>(&self, t: T);
31
31
= help: consider moving `bar` to another trait
32
32
33
33
error[E0038]: the trait `Bar` is not dyn compatible
34
-
--> $DIR/generics.rs:17:5
35
-
|
36
-
LL | t
37
-
| ^ `Bar` is not dyn compatible
38
-
|
39
-
note: for a trait to be dyn compatible it needs to allow building a vtable
40
-
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
41
-
--> $DIR/generics.rs:7:8
42
-
|
43
-
LL | trait Bar {
44
-
| --- this trait is not dyn compatible...
45
-
LL | fn bar<T>(&self, t: T);
46
-
| ^^^ ...because method `bar` has generic type parameters
47
-
= help: consider moving `bar` to another trait
48
-
= note: required for the cast from `&T` to `&dyn Bar`
49
-
50
-
error[E0038]: the trait `Bar` is not dyn compatible
51
-
--> $DIR/generics.rs:23:10
34
+
--> $DIR/generics.rs:22:10
52
35
|
53
36
LL | t as &dyn Bar
54
37
| ^^^^^^^^ `Bar` is not dyn compatible
@@ -63,23 +46,6 @@ LL | fn bar<T>(&self, t: T);
63
46
| ^^^ ...because method `bar` has generic type parameters
64
47
= help: consider moving `bar` to another trait
65
48
66
-
error[E0038]: the trait `Bar` is not dyn compatible
67
-
--> $DIR/generics.rs:23:5
68
-
|
69
-
LL | t as &dyn Bar
70
-
| ^ `Bar` is not dyn compatible
71
-
|
72
-
note: for a trait to be dyn compatible it needs to allow building a vtable
73
-
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
74
-
--> $DIR/generics.rs:7:8
75
-
|
76
-
LL | trait Bar {
77
-
| --- this trait is not dyn compatible...
78
-
LL | fn bar<T>(&self, t: T);
79
-
| ^^^ ...because method `bar` has generic type parameters
80
-
= help: consider moving `bar` to another trait
81
-
= note: required for the cast from `&T` to `&dyn Bar`
82
-
83
-
error: aborting due to 5 previous errors
49
+
error: aborting due to 3 previous errors
84
50
85
51
For more information about this error, try `rustc --explain E0038`.
0 commit comments