1
- error[E0277]: the size for values of type `T` cannot be known at compilation time
2
- --> $DIR/assoc_type_bounds_sized_used.rs:12:14
3
- |
4
- LL | fn bop<T: Bop + ?Sized>() {
5
- | - this type parameter needs to be `Sized`
6
- LL | let _ = <T as Bop>::Bar::default();
7
- | ^ doesn't have a size known at compile-time
8
- |
9
- note: required by a bound in `Bop::Bar`
10
- --> $DIR/assoc_type_bounds_sized_used.rs:8:15
11
- |
12
- LL | type Bar: Default
13
- | --- required by a bound in this associated type
14
- LL | where
15
- LL | Self: Sized;
16
- | ^^^^^ required by this bound in `Bop::Bar`
17
- help: consider removing the `?Sized` bound to make the type parameter `Sized`
18
- |
19
- LL - fn bop<T: Bop + ?Sized>() {
20
- LL + fn bop<T: Bop>() {
21
- |
22
-
23
1
error[E0599]: the function or associated item `default` exists for associated type `<T as Bop>::Bar`, but its trait bounds were not satisfied
24
2
--> $DIR/assoc_type_bounds_sized_used.rs:12:30
25
3
|
@@ -35,12 +13,12 @@ LL | fn bop<T: Bop + ?Sized>() where T: Sized {
35
13
| ++++++++++++++
36
14
37
15
error[E0277]: the size for values of type `T` cannot be known at compilation time
38
- --> $DIR/assoc_type_bounds_sized_used.rs:12:13
16
+ --> $DIR/assoc_type_bounds_sized_used.rs:12:14
39
17
|
40
18
LL | fn bop<T: Bop + ?Sized>() {
41
19
| - this type parameter needs to be `Sized`
42
20
LL | let _ = <T as Bop>::Bar::default();
43
- | ^^^^^^^^^^^^^^ ^ doesn't have a size known at compile-time
21
+ | ^ doesn't have a size known at compile-time
44
22
|
45
23
note: required by a bound in `Bop::Bar`
46
24
--> $DIR/assoc_type_bounds_sized_used.rs:8:15
@@ -57,7 +35,7 @@ LL + fn bop<T: Bop>() {
57
35
|
58
36
59
37
error[E0277]: the size for values of type `dyn Bop` cannot be known at compilation time
60
- --> $DIR/assoc_type_bounds_sized_used.rs:19 :11
38
+ --> $DIR/assoc_type_bounds_sized_used.rs:18 :11
61
39
|
62
40
LL | bop::<dyn Bop>();
63
41
| ^^^^^^^ doesn't have a size known at compile-time
@@ -69,7 +47,7 @@ note: required by a bound in `bop`
69
47
LL | fn bop<T: Bop + ?Sized>() {
70
48
| ^^^ required by this bound in `bop`
71
49
72
- error: aborting due to 4 previous errors
50
+ error: aborting due to 3 previous errors
73
51
74
52
Some errors have detailed explanations: E0277, E0599.
75
53
For more information about an error, try `rustc --explain E0277`.
0 commit comments