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: src/test/ui/associated-consts/associated-const-in-trait.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@ error[E0038]: the trait `Trait` cannot be made into an object
4
4
LL | impl dyn Trait {
5
5
| ^^^^^^^^^ `Trait` cannot be made into an object
6
6
|
7
-
= help: consider moving `N` to another trait
8
7
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
8
--> $DIR/associated-const-in-trait.rs:6:11
10
9
|
11
10
LL | trait Trait {
12
11
| ----- this trait cannot be made into an object...
13
12
LL | const N: usize;
14
13
| ^ ...because it contains this associated `const`
Copy file name to clipboardExpand all lines: src/test/ui/associated-item/issue-48027.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -21,14 +21,14 @@ error[E0038]: the trait `Bar` cannot be made into an object
21
21
LL | impl dyn Bar {}
22
22
| ^^^^^^^ `Bar` cannot be made into an object
23
23
|
24
-
= help: consider moving `X` to another trait
25
24
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>
26
25
--> $DIR/issue-48027.rs:2:11
27
26
|
28
27
LL | trait Bar {
29
28
| --- this trait cannot be made into an object...
30
29
LL | const X: usize;
31
30
| ^ ...because it contains this associated `const`
Copy file name to clipboardExpand all lines: src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@ error[E0038]: the trait `NotObjectSafe` cannot be made into an object
4
4
LL | impl NotObjectSafe for dyn NotObjectSafe { }
5
5
| ^^^^^^^^^^^^^^^^^ `NotObjectSafe` cannot be made into an object
6
6
|
7
-
= help: consider moving `eq` to another trait
8
7
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>
Copy file name to clipboardExpand all lines: src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@ error[E0038]: the trait `Foo` cannot be made into an object
4
4
LL | fn use_dyn(v: &dyn Foo) {
5
5
| ^^^^^^^ `Foo` cannot be made into an object
6
6
|
7
-
= help: consider moving `test` to another trait
8
7
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
8
--> $DIR/object-safety-err-ret.rs:8:23
10
9
|
11
10
LL | trait Foo {
12
11
| --- this trait cannot be made into an object...
13
12
LL | fn test(&self) -> [u8; bar::<Self>()];
14
13
| ^^^^^^^^^^^^^^^^^^^ ...because method `test` references the `Self` type in its return type
Copy file name to clipboardExpand all lines: src/test/ui/error-codes/E0038.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@ error[E0038]: the trait `Trait` cannot be made into an object
4
4
LL | fn call_foo(x: Box<dyn Trait>) {
5
5
| ^^^^^^^^^ `Trait` cannot be made into an object
6
6
|
7
-
= help: consider moving `foo` to another trait
8
7
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
8
--> $DIR/E0038.rs:2:22
10
9
|
11
10
LL | trait Trait {
12
11
| ----- this trait cannot be made into an object...
13
12
LL | fn foo(&self) -> Self;
14
13
| ^^^^ ...because method `foo` references the `Self` type in its return type
| ^^^^^^^^^^^^^^^^^^ `NonObjectSafe3` cannot be made into an object
42
42
|
43
-
= help: consider moving `foo` to another trait
44
43
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>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `NonObjectSafe4` cannot be made into an object
57
57
|
58
-
= help: consider moving `foo` to another trait
59
58
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>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Foo` cannot be made into an object
6
6
|
7
-
= help: consider moving `A` to another trait
8
7
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
8
--> $DIR/gat-in-trait-path.rs:5:10
10
9
|
11
10
LL | trait Foo {
12
11
| --- this trait cannot be made into an object...
13
12
LL | type A<'a> where Self: 'a;
14
13
| ^ ...because it contains the generic associated type `A`
| ^^^^^^^^^^^^^^^^^^^ `X` cannot be made into an object
6
6
|
7
-
= help: consider moving `Y` to another trait
8
7
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
8
--> $DIR/issue-67510-pass.rs:4:10
10
9
|
11
10
LL | trait X {
12
11
| - this trait cannot be made into an object...
13
12
LL | type Y<'a>;
14
13
| ^ ...because it contains the generic associated type `Y`
Copy file name to clipboardExpand all lines: src/test/ui/generic-associated-types/issue-76535.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -20,29 +20,29 @@ error[E0038]: the trait `SuperTrait` cannot be made into an object
20
20
LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
21
21
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SuperTrait` cannot be made into an object
22
22
|
23
-
= help: consider moving `SubType` to another trait
24
23
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>
25
24
--> $DIR/issue-76535.rs:6:10
26
25
|
27
26
LL | pub trait SuperTrait {
28
27
| ---------- this trait cannot be made into an object...
29
28
LL | type SubType<'a>: SubTrait;
30
29
| ^^^^^^^ ...because it contains the generic associated type `SubType`
30
+
= help: consider moving `SubType` to another trait
31
31
32
32
error[E0038]: the trait `SuperTrait` cannot be made into an object
33
33
--> $DIR/issue-76535.rs:36:57
34
34
|
35
35
LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
36
36
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SuperTrait` cannot be made into an object
37
37
|
38
-
= help: consider moving `SubType` to another trait
39
38
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>
40
39
--> $DIR/issue-76535.rs:6:10
41
40
|
42
41
LL | pub trait SuperTrait {
43
42
| ---------- this trait cannot be made into an object...
44
43
LL | type SubType<'a>: SubTrait;
45
44
| ^^^^^^^ ...because it contains the generic associated type `SubType`
45
+
= help: consider moving `SubType` to another trait
46
46
= note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn SuperTrait<SubType = SubStruct<'_>>>>` for `Box<SuperStruct>`
47
47
= note: required by cast to type `Box<dyn SuperTrait<SubType = SubStruct<'_>>>`
Copy file name to clipboardExpand all lines: src/test/ui/generic-associated-types/issue-78671.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -20,14 +20,14 @@ error[E0038]: the trait `CollectionFamily` cannot be made into an object
20
20
LL | Box::new(Family) as &dyn CollectionFamily<Member=usize>
21
21
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `CollectionFamily` cannot be made into an object
22
22
|
23
-
= help: consider moving `Member` to another trait
24
23
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>
25
24
--> $DIR/issue-78671.rs:4:10
26
25
|
27
26
LL | trait CollectionFamily {
28
27
| ---------------- this trait cannot be made into an object...
29
28
LL | type Member<T>;
30
29
| ^^^^^^ ...because it contains the generic associated type `Member`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `MapLike` cannot be made into an object
22
22
|
23
-
= help: consider moving `VRefCont` to another trait
24
23
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>
25
24
--> $DIR/issue-79422.rs:20:10
26
25
|
27
26
LL | trait MapLike<K, V> {
28
27
| ------- this trait cannot be made into an object...
29
28
LL | type VRefCont<'a>: RefCont<'a, V>;
30
29
| ^^^^^^^^ ...because it contains the generic associated type `VRefCont`
30
+
= help: consider moving `VRefCont` to another trait
31
31
32
32
error[E0038]: the trait `MapLike` cannot be made into an object
33
33
--> $DIR/issue-79422.rs:41:13
34
34
|
35
35
LL | let m = Box::new(std::collections::BTreeMap::<u8, u8>::new())
36
36
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `MapLike` cannot be made into an object
37
37
|
38
-
= help: consider moving `VRefCont` to another trait
39
38
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>
40
39
--> $DIR/issue-79422.rs:20:10
41
40
|
42
41
LL | trait MapLike<K, V> {
43
42
| ------- this trait cannot be made into an object...
44
43
LL | type VRefCont<'a>: RefCont<'a, V>;
45
44
| ^^^^^^^^ ...because it contains the generic associated type `VRefCont`
45
+
= help: consider moving `VRefCont` to another trait
46
46
= note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn MapLike<u8, u8, VRefCont = (dyn RefCont<'_, u8> + 'static)>>>` for `Box<BTreeMap<u8, u8>>`
47
47
= note: required by cast to type `Box<dyn MapLike<u8, u8, VRefCont = (dyn RefCont<'_, u8> + 'static)>>`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `StreamingIterator` cannot be made into an object
6
6
|
7
-
= help: consider moving `Item` to another trait
8
7
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
8
--> $DIR/trait-objects.rs:4:10
10
9
|
11
10
LL | trait StreamingIterator {
12
11
| ----------------- this trait cannot be made into an object...
13
12
LL | type Item<'a> where Self: 'a;
14
13
| ^^^^ ...because it contains the generic associated type `Item`
Copy file name to clipboardExpand all lines: src/test/ui/issues/issue-18959.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@ error[E0038]: the trait `Bar` cannot be made into an object
4
4
LL | fn foo(b: &dyn Bar) {
5
5
| ^^^^^^^ `Bar` cannot be made into an object
6
6
|
7
-
= help: consider moving `foo` to another trait
8
7
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>
Copy file name to clipboardExpand all lines: src/test/ui/issues/issue-19538.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,6 @@ error[E0038]: the trait `Bar` cannot be made into an object
4
4
LL | let test: &mut dyn Bar = &mut thing;
5
5
| ^^^^^^^^^^^^ `Bar` cannot be made into an object
6
6
|
7
-
= help: consider moving `foo` to another trait
8
7
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>
error[E0038]: the trait `Bar` cannot be made into an object
18
18
--> $DIR/issue-19538.rs:17:30
19
19
|
20
20
LL | let test: &mut dyn Bar = &mut thing;
21
21
| ^^^^^^^^^^ `Bar` cannot be made into an object
22
22
|
23
-
= help: consider moving `foo` to another trait
24
23
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>
25
24
--> $DIR/issue-19538.rs:2:8
26
25
|
@@ -29,6 +28,7 @@ LL | fn foo<T>(&self, val: T);
29
28
...
30
29
LL | trait Bar: Foo { }
31
30
| --- this trait cannot be made into an object...
31
+
= help: consider moving `foo` to another trait
32
32
= note: required because of the requirements on the impl of `CoerceUnsized<&mut dyn Bar>` for `&mut Thing`
Copy file name to clipboardExpand all lines: src/test/ui/object-safety/object-safety-associated-consts.curr.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@ error[E0038]: the trait `Bar` cannot be made into an object
4
4
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
5
5
| ^^^^^^^^ `Bar` cannot be made into an object
6
6
|
7
-
= help: consider moving `X` to another trait
8
7
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
8
--> $DIR/object-safety-associated-consts.rs:9:11
10
9
|
11
10
LL | trait Bar {
12
11
| --- this trait cannot be made into an object...
13
12
LL | const X: usize;
14
13
| ^ ...because it contains this associated `const`
Copy file name to clipboardExpand all lines: src/test/ui/object-safety/object-safety-associated-consts.object_safe_for_dispatch.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@ error[E0038]: the trait `Bar` cannot be made into an object
4
4
LL | t
5
5
| ^ `Bar` cannot be made into an object
6
6
|
7
-
= help: consider moving `X` to another trait
8
7
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
8
--> $DIR/object-safety-associated-consts.rs:9:11
10
9
|
11
10
LL | trait Bar {
12
11
| --- this trait cannot be made into an object...
13
12
LL | const X: usize;
14
13
| ^ ...because it contains this associated `const`
14
+
= help: consider moving `X` to another trait
15
15
= note: required because of the requirements on the impl of `CoerceUnsized<&dyn Bar>` for `&T`
0 commit comments