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
help: if there were a trait named `Example` with associated type `IntoIterator` implemented for `(dyn IntoIterator + 'static)`, you could use the fully-qualified path
14
-
|
15
-
LL | inner: <<(dyn IntoIterator + 'static) as Example>::IntoIterator as Item>::Core,
Copy file name to clipboardexpand all lines: tests/ui/async-await/async-fn/dyn-pos.stderr
+1-47
Original file line number
Diff line number
Diff line change
@@ -13,52 +13,6 @@ note: for a trait to be "dyn-compatible" it needs to allow building a vtable to
13
13
&mut F
14
14
std::boxed::Box<F, A>
15
15
16
-
error[E0038]: the trait `AsyncFnMut` cannot be made into an object
17
-
--> $DIR/dyn-pos.rs:5:16
18
-
|
19
-
LL | fn foo(x: &dyn async Fn()) {}
20
-
| ^^^^^^^^^^ `AsyncFnMut` cannot be made into an object
21
-
|
22
-
note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
= note: the trait cannot be made into an object because it contains the generic associated type `CallRefFuture`
26
-
= help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `AsyncFnMut` for this new enum and using it instead:
27
-
&F
28
-
&mut F
29
-
std::boxed::Box<F, A>
30
-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
31
-
32
-
error[E0038]: the trait `AsyncFnMut` cannot be made into an object
33
-
--> $DIR/dyn-pos.rs:5:16
34
-
|
35
-
LL | fn foo(x: &dyn async Fn()) {}
36
-
| ^^^^^^^^^^ `AsyncFnMut` cannot be made into an object
37
-
|
38
-
note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
= note: the trait cannot be made into an object because it contains the generic associated type `CallRefFuture`
42
-
= help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `AsyncFnMut` for this new enum and using it instead:
43
-
&F
44
-
&mut F
45
-
std::boxed::Box<F, A>
46
-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
47
-
48
-
error[E0038]: the trait `AsyncFn` cannot be made into an object
49
-
--> $DIR/dyn-pos.rs:5:12
50
-
|
51
-
LL | fn foo(x: &dyn async Fn()) {}
52
-
| ^^^^^^^^^^^^^^ `AsyncFn` cannot be made into an object
53
-
|
54
-
note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
= note: the trait cannot be made into an object because it contains the generic associated type `CallRefFuture`
58
-
= help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `AsyncFn` for this new enum and using it instead:
59
-
&F
60
-
std::boxed::Box<F, A>
61
-
62
-
error: aborting due to 4 previous errors
16
+
error: aborting due to 1 previous error
63
17
64
18
For more information about this error, try `rustc --explain E0038`.
Copy file name to clipboardexpand all lines: tests/ui/dyn-compatibility/missing-assoc-type.stderr
+1-48
Original file line number
Diff line number
Diff line change
@@ -13,53 +13,6 @@ LL | type Bar<T>;
13
13
| ^^^ ...because it contains the generic associated type `Bar`
14
14
= help: consider moving `Bar` to another trait
15
15
16
-
error[E0038]: the trait `Foo` cannot be made into an object
17
-
--> $DIR/missing-assoc-type.rs:5:16
18
-
|
19
-
LL | fn bar(x: &dyn Foo) {}
20
-
| ^^^ `Foo` cannot be made into an object
21
-
|
22
-
note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
23
-
--> $DIR/missing-assoc-type.rs:2:10
24
-
|
25
-
LL | trait Foo {
26
-
| --- this trait cannot be made into an object...
27
-
LL | type Bar<T>;
28
-
| ^^^ ...because it contains the generic associated type `Bar`
29
-
= help: consider moving `Bar` to another trait
30
-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
31
-
32
-
error[E0038]: the trait `Foo` cannot be made into an object
33
-
--> $DIR/missing-assoc-type.rs:5:16
34
-
|
35
-
LL | fn bar(x: &dyn Foo) {}
36
-
| ^^^ `Foo` cannot be made into an object
37
-
|
38
-
note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
39
-
--> $DIR/missing-assoc-type.rs:2:10
40
-
|
41
-
LL | trait Foo {
42
-
| --- this trait cannot be made into an object...
43
-
LL | type Bar<T>;
44
-
| ^^^ ...because it contains the generic associated type `Bar`
45
-
= help: consider moving `Bar` to another trait
46
-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
47
-
48
-
error[E0038]: the trait `Foo` cannot be made into an object
49
-
--> $DIR/missing-assoc-type.rs:5:12
50
-
|
51
-
LL | fn bar(x: &dyn Foo) {}
52
-
| ^^^^^^^ `Foo` cannot be made into an object
53
-
|
54
-
note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
55
-
--> $DIR/missing-assoc-type.rs:2:10
56
-
|
57
-
LL | trait Foo {
58
-
| --- this trait cannot be made into an object...
59
-
LL | type Bar<T>;
60
-
| ^^^ ...because it contains the generic associated type `Bar`
61
-
= help: consider moving `Bar` to another trait
62
-
63
-
error: aborting due to 4 previous errors
16
+
error: aborting due to 1 previous error
64
17
65
18
For more information about this error, try `rustc --explain E0038`.
0 commit comments