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
Copy file name to clipboardExpand all lines: tests/ui/suggestions/issue-116434-2015.stderr
+12-4
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ LL | fn foo() -> dyn Clone;
13
13
| +++
14
14
15
15
warning: trait objects without an explicit `dyn` are deprecated
16
-
--> $DIR/issue-116434-2015.rs:15:20
16
+
--> $DIR/issue-116434-2015.rs:18:20
17
17
|
18
18
LL | fn handle() -> DbHandle;
19
19
| ^^^^^^^^
@@ -47,9 +47,13 @@ LL | fn foo() -> Clone;
47
47
|
48
48
= note: the trait cannot be made into an object because it requires `Self: Sized`
49
49
= note: for a trait to be "object safe" 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>
50
+
help: there is an associated type with the same name
51
+
|
52
+
LL | fn foo() -> Self::Clone;
53
+
| ++++++
50
54
51
55
warning: trait objects without an explicit `dyn` are deprecated
error[E0038]: the trait `DbHandle` cannot be made into an object
66
-
--> $DIR/issue-116434-2015.rs:15:20
70
+
--> $DIR/issue-116434-2015.rs:18:20
67
71
|
68
72
LL | fn handle() -> DbHandle;
69
73
| ^^^^^^^^ `DbHandle` cannot be made into an object
70
74
|
71
75
note: for a trait to be "object safe" 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>
72
-
--> $DIR/issue-116434-2015.rs:11:17
76
+
--> $DIR/issue-116434-2015.rs:14:17
73
77
|
74
78
LL | trait DbHandle: Sized {}
75
79
| -------- ^^^^^ ...because it requires `Self: Sized`
76
80
| |
77
81
| this trait cannot be made into an object...
82
+
help: there is an associated type with the same name
83
+
|
84
+
LL | fn handle() -> Self::DbHandle;
85
+
| ++++++
78
86
79
87
error: aborting due to 2 previous errors; 4 warnings emitted
Copy file name to clipboardExpand all lines: tests/ui/suggestions/issue-116434-2021.stderr
+10-2
Original file line number
Diff line number
Diff line change
@@ -6,20 +6,28 @@ LL | fn foo() -> Clone;
6
6
|
7
7
= note: the trait cannot be made into an object because it requires `Self: Sized`
8
8
= note: for a trait to be "object safe" 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>
9
+
help: there is an associated type with the same name
10
+
|
11
+
LL | fn foo() -> Self::Clone;
12
+
| ++++++
9
13
10
14
error[E0038]: the trait `DbHandle` cannot be made into an object
11
-
--> $DIR/issue-116434-2021.rs:13:20
15
+
--> $DIR/issue-116434-2021.rs:14:20
12
16
|
13
17
LL | fn handle() -> DbHandle;
14
18
| ^^^^^^^^ `DbHandle` cannot be made into an object
15
19
|
16
20
note: for a trait to be "object safe" 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>
17
-
--> $DIR/issue-116434-2021.rs:9:17
21
+
--> $DIR/issue-116434-2021.rs:10:17
18
22
|
19
23
LL | trait DbHandle: Sized {}
20
24
| -------- ^^^^^ ...because it requires `Self: Sized`
21
25
| |
22
26
| this trait cannot be made into an object...
27
+
help: there is an associated type with the same name
0 commit comments