@@ -76,6 +76,86 @@ help: consider further restricting type parameter `X`
76
76
LL | fn test_many_bounds_where<X>(x: X) where X: Sized, X: Sized, X: Debug {
77
77
| ^^^^^^^^^^
78
78
79
- error: aborting due to 6 previous errors
79
+ error[E0277]: the size for values of type `Self` cannot be known at compilation time
80
+ --> $DIR/bound-suggestions.rs:44:46
81
+ |
82
+ LL | const SIZE: usize = core::mem::size_of::<Self>();
83
+ | ^^^^ doesn't have a size known at compile-time
84
+ |
85
+ ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
86
+ |
87
+ LL | pub const fn size_of<T>() -> usize {
88
+ | - required by this bound in `std::mem::size_of`
89
+ |
90
+ help: consider further restricting `Self`
91
+ |
92
+ LL | trait Foo<T>: Sized {
93
+ | ^^^^^^^
94
+
95
+ error[E0277]: the size for values of type `Self` cannot be known at compilation time
96
+ --> $DIR/bound-suggestions.rs:49:46
97
+ |
98
+ LL | const SIZE: usize = core::mem::size_of::<Self>();
99
+ | ^^^^ doesn't have a size known at compile-time
100
+ |
101
+ ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
102
+ |
103
+ LL | pub const fn size_of<T>() -> usize {
104
+ | - required by this bound in `std::mem::size_of`
105
+ |
106
+ help: consider further restricting `Self`
107
+ |
108
+ LL | trait Bar: std::fmt::Display + Sized {
109
+ | ^^^^^^^
110
+
111
+ error[E0277]: the size for values of type `Self` cannot be known at compilation time
112
+ --> $DIR/bound-suggestions.rs:54:46
113
+ |
114
+ LL | const SIZE: usize = core::mem::size_of::<Self>();
115
+ | ^^^^ doesn't have a size known at compile-time
116
+ |
117
+ ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
118
+ |
119
+ LL | pub const fn size_of<T>() -> usize {
120
+ | - required by this bound in `std::mem::size_of`
121
+ |
122
+ help: consider further restricting `Self`
123
+ |
124
+ LL | trait Baz: Sized where Self: std::fmt::Display {
125
+ | ^^^^^^^
126
+
127
+ error[E0277]: the size for values of type `Self` cannot be known at compilation time
128
+ --> $DIR/bound-suggestions.rs:59:46
129
+ |
130
+ LL | const SIZE: usize = core::mem::size_of::<Self>();
131
+ | ^^^^ doesn't have a size known at compile-time
132
+ |
133
+ ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
134
+ |
135
+ LL | pub const fn size_of<T>() -> usize {
136
+ | - required by this bound in `std::mem::size_of`
137
+ |
138
+ help: consider further restricting `Self`
139
+ |
140
+ LL | trait Qux<T>: Sized where Self: std::fmt::Display {
141
+ | ^^^^^^^
142
+
143
+ error[E0277]: the size for values of type `Self` cannot be known at compilation time
144
+ --> $DIR/bound-suggestions.rs:64:46
145
+ |
146
+ LL | const SIZE: usize = core::mem::size_of::<Self>();
147
+ | ^^^^ doesn't have a size known at compile-time
148
+ |
149
+ ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
150
+ |
151
+ LL | pub const fn size_of<T>() -> usize {
152
+ | - required by this bound in `std::mem::size_of`
153
+ |
154
+ help: consider further restricting `Self`
155
+ |
156
+ LL | trait Bat<T>: std::fmt::Display + Sized {
157
+ | ^^^^^^^
158
+
159
+ error: aborting due to 11 previous errors
80
160
81
161
For more information about this error, try `rustc --explain E0277`.
0 commit comments