Skip to content

Commit ff75395

Browse files
committed
Reword message
1 parent c38b127 commit ff75395

File tree

7 files changed

+35
-34
lines changed

7 files changed

+35
-34
lines changed

src/librustc_trait_selection/traits/error_reporting/suggestions.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,8 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
18821882
Applicability::MachineApplicable,
18831883
);
18841884
err.multipart_suggestion(
1885-
"heap allocated types always have a statically known size",
1885+
"the `Box` type always has a statically known size and allocates its contents \
1886+
in the heap",
18861887
vec![
18871888
(span.shrink_to_lo(), "Box<".to_string()),
18881889
(span.shrink_to_hi(), ">".to_string()),

src/test/ui/issues/issue-27060-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ help: borrowed types always have a statically known size
1212
|
1313
LL | data: &T,
1414
| ^
15-
help: heap allocated types always have a statically known size
15+
help: the `Box` type always has a statically known size and allocates its contents in the heap
1616
|
1717
LL | data: Box<T>,
1818
| ^^^^ ^

src/test/ui/issues/issue-35988.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ help: borrowed types always have a statically known size
1111
|
1212
LL | V(&[Box<E>]),
1313
| ^
14-
help: heap allocated types always have a statically known size
14+
help: the `Box` type always has a statically known size and allocates its contents in the heap
1515
|
1616
LL | V(Box<[Box<E>]>),
1717
| ^^^^ ^

src/test/ui/union/union-sized-field.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ help: borrowed types always have a statically known size
1212
|
1313
LL | value: &T,
1414
| ^
15-
help: heap allocated types always have a statically known size
15+
help: the `Box` type always has a statically known size and allocates its contents in the heap
1616
|
1717
LL | value: Box<T>,
1818
| ^^^^ ^
@@ -31,7 +31,7 @@ help: borrowed types always have a statically known size
3131
|
3232
LL | value: &T,
3333
| ^
34-
help: heap allocated types always have a statically known size
34+
help: the `Box` type always has a statically known size and allocates its contents in the heap
3535
|
3636
LL | value: Box<T>,
3737
| ^^^^ ^
@@ -50,7 +50,7 @@ help: borrowed types always have a statically known size
5050
|
5151
LL | Value(&T),
5252
| ^
53-
help: heap allocated types always have a statically known size
53+
help: the `Box` type always has a statically known size and allocates its contents in the heap
5454
|
5555
LL | Value(Box<T>),
5656
| ^^^^ ^

src/test/ui/union/union-unsized.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ help: borrowed types always have a statically known size
1111
|
1212
LL | a: &str,
1313
| ^
14-
help: heap allocated types always have a statically known size
14+
help: the `Box` type always has a statically known size and allocates its contents in the heap
1515
|
1616
LL | a: Box<str>,
1717
| ^^^^ ^
@@ -29,7 +29,7 @@ help: borrowed types always have a statically known size
2929
|
3030
LL | b: &str,
3131
| ^
32-
help: heap allocated types always have a statically known size
32+
help: the `Box` type always has a statically known size and allocates its contents in the heap
3333
|
3434
LL | b: Box<str>,
3535
| ^^^^ ^

src/test/ui/unsized/unsized-enum2.stderr

+20-20
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ help: borrowed types always have a statically known size
1313
|
1414
LL | VA(&W),
1515
| ^
16-
help: heap allocated types always have a statically known size
16+
help: the `Box` type always has a statically known size and allocates its contents in the heap
1717
|
1818
LL | VA(Box<W>),
1919
| ^^^^ ^
@@ -33,7 +33,7 @@ help: borrowed types always have a statically known size
3333
|
3434
LL | VB{x: &X},
3535
| ^
36-
help: heap allocated types always have a statically known size
36+
help: the `Box` type always has a statically known size and allocates its contents in the heap
3737
|
3838
LL | VB{x: Box<X>},
3939
| ^^^^ ^
@@ -53,7 +53,7 @@ help: borrowed types always have a statically known size
5353
|
5454
LL | VC(isize, &Y),
5555
| ^
56-
help: heap allocated types always have a statically known size
56+
help: the `Box` type always has a statically known size and allocates its contents in the heap
5757
|
5858
LL | VC(isize, Box<Y>),
5959
| ^^^^ ^
@@ -73,7 +73,7 @@ help: borrowed types always have a statically known size
7373
|
7474
LL | VD{u: isize, x: &Z},
7575
| ^
76-
help: heap allocated types always have a statically known size
76+
help: the `Box` type always has a statically known size and allocates its contents in the heap
7777
|
7878
LL | VD{u: isize, x: Box<Z>},
7979
| ^^^^ ^
@@ -91,7 +91,7 @@ help: borrowed types always have a statically known size
9191
|
9292
LL | VE(&[u8]),
9393
| ^
94-
help: heap allocated types always have a statically known size
94+
help: the `Box` type always has a statically known size and allocates its contents in the heap
9595
|
9696
LL | VE(Box<[u8]>),
9797
| ^^^^ ^
@@ -109,7 +109,7 @@ help: borrowed types always have a statically known size
109109
|
110110
LL | VF{x: &str},
111111
| ^
112-
help: heap allocated types always have a statically known size
112+
help: the `Box` type always has a statically known size and allocates its contents in the heap
113113
|
114114
LL | VF{x: Box<str>},
115115
| ^^^^ ^
@@ -127,7 +127,7 @@ help: borrowed types always have a statically known size
127127
|
128128
LL | VG(isize, &[f32]),
129129
| ^
130-
help: heap allocated types always have a statically known size
130+
help: the `Box` type always has a statically known size and allocates its contents in the heap
131131
|
132132
LL | VG(isize, Box<[f32]>),
133133
| ^^^^ ^
@@ -145,7 +145,7 @@ help: borrowed types always have a statically known size
145145
|
146146
LL | VH{u: isize, x: &[u32]},
147147
| ^
148-
help: heap allocated types always have a statically known size
148+
help: the `Box` type always has a statically known size and allocates its contents in the heap
149149
|
150150
LL | VH{u: isize, x: Box<[u32]>},
151151
| ^^^^ ^
@@ -163,7 +163,7 @@ help: borrowed types always have a statically known size
163163
|
164164
LL | VM(&dyn Foo),
165165
| ^
166-
help: heap allocated types always have a statically known size
166+
help: the `Box` type always has a statically known size and allocates its contents in the heap
167167
|
168168
LL | VM(Box<dyn Foo>),
169169
| ^^^^ ^
@@ -181,7 +181,7 @@ help: borrowed types always have a statically known size
181181
|
182182
LL | VN{x: &dyn Bar},
183183
| ^
184-
help: heap allocated types always have a statically known size
184+
help: the `Box` type always has a statically known size and allocates its contents in the heap
185185
|
186186
LL | VN{x: Box<dyn Bar>},
187187
| ^^^^ ^
@@ -199,7 +199,7 @@ help: borrowed types always have a statically known size
199199
|
200200
LL | VO(isize, &dyn FooBar),
201201
| ^
202-
help: heap allocated types always have a statically known size
202+
help: the `Box` type always has a statically known size and allocates its contents in the heap
203203
|
204204
LL | VO(isize, Box<dyn FooBar>),
205205
| ^^^^ ^
@@ -217,7 +217,7 @@ help: borrowed types always have a statically known size
217217
|
218218
LL | VP{u: isize, x: &dyn BarFoo},
219219
| ^
220-
help: heap allocated types always have a statically known size
220+
help: the `Box` type always has a statically known size and allocates its contents in the heap
221221
|
222222
LL | VP{u: isize, x: Box<dyn BarFoo>},
223223
| ^^^^ ^
@@ -235,7 +235,7 @@ help: borrowed types always have a statically known size
235235
|
236236
LL | VQ(&<&'static [i8] as Deref>::Target),
237237
| ^
238-
help: heap allocated types always have a statically known size
238+
help: the `Box` type always has a statically known size and allocates its contents in the heap
239239
|
240240
LL | VQ(Box<<&'static [i8] as Deref>::Target>),
241241
| ^^^^ ^
@@ -253,7 +253,7 @@ help: borrowed types always have a statically known size
253253
|
254254
LL | VR{x: &<&'static [char] as Deref>::Target},
255255
| ^
256-
help: heap allocated types always have a statically known size
256+
help: the `Box` type always has a statically known size and allocates its contents in the heap
257257
|
258258
LL | VR{x: Box<<&'static [char] as Deref>::Target>},
259259
| ^^^^ ^
@@ -271,7 +271,7 @@ help: borrowed types always have a statically known size
271271
|
272272
LL | VS(isize, &<&'static [f64] as Deref>::Target),
273273
| ^
274-
help: heap allocated types always have a statically known size
274+
help: the `Box` type always has a statically known size and allocates its contents in the heap
275275
|
276276
LL | VS(isize, Box<<&'static [f64] as Deref>::Target>),
277277
| ^^^^ ^
@@ -289,7 +289,7 @@ help: borrowed types always have a statically known size
289289
|
290290
LL | VT{u: isize, x: &<&'static [i32] as Deref>::Target},
291291
| ^
292-
help: heap allocated types always have a statically known size
292+
help: the `Box` type always has a statically known size and allocates its contents in the heap
293293
|
294294
LL | VT{u: isize, x: Box<<&'static [i32] as Deref>::Target>},
295295
| ^^^^ ^
@@ -308,7 +308,7 @@ help: borrowed types always have a statically known size
308308
|
309309
LL | VI(&Path1),
310310
| ^
311-
help: heap allocated types always have a statically known size
311+
help: the `Box` type always has a statically known size and allocates its contents in the heap
312312
|
313313
LL | VI(Box<Path1>),
314314
| ^^^^ ^
@@ -327,7 +327,7 @@ help: borrowed types always have a statically known size
327327
|
328328
LL | VJ{x: &Path2},
329329
| ^
330-
help: heap allocated types always have a statically known size
330+
help: the `Box` type always has a statically known size and allocates its contents in the heap
331331
|
332332
LL | VJ{x: Box<Path2>},
333333
| ^^^^ ^
@@ -346,7 +346,7 @@ help: borrowed types always have a statically known size
346346
|
347347
LL | VK(isize, &Path3),
348348
| ^
349-
help: heap allocated types always have a statically known size
349+
help: the `Box` type always has a statically known size and allocates its contents in the heap
350350
|
351351
LL | VK(isize, Box<Path3>),
352352
| ^^^^ ^
@@ -365,7 +365,7 @@ help: borrowed types always have a statically known size
365365
|
366366
LL | VL{u: isize, x: &Path4},
367367
| ^
368-
help: heap allocated types always have a statically known size
368+
help: the `Box` type always has a statically known size and allocates its contents in the heap
369369
|
370370
LL | VL{u: isize, x: Box<Path4>},
371371
| ^^^^ ^

src/test/ui/unsized5.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ help: borrowed types always have a statically known size
1212
|
1313
LL | f1: &X,
1414
| ^
15-
help: heap allocated types always have a statically known size
15+
help: the `Box` type always has a statically known size and allocates its contents in the heap
1616
|
1717
LL | f1: Box<X>,
1818
| ^^^^ ^
@@ -32,7 +32,7 @@ help: borrowed types always have a statically known size
3232
|
3333
LL | g: &X,
3434
| ^
35-
help: heap allocated types always have a statically known size
35+
help: the `Box` type always has a statically known size and allocates its contents in the heap
3636
|
3737
LL | g: Box<X>,
3838
| ^^^^ ^
@@ -50,7 +50,7 @@ help: borrowed types always have a statically known size
5050
|
5151
LL | f: &str,
5252
| ^
53-
help: heap allocated types always have a statically known size
53+
help: the `Box` type always has a statically known size and allocates its contents in the heap
5454
|
5555
LL | f: Box<str>,
5656
| ^^^^ ^
@@ -68,7 +68,7 @@ help: borrowed types always have a statically known size
6868
|
6969
LL | f: &[u8],
7070
| ^
71-
help: heap allocated types always have a statically known size
71+
help: the `Box` type always has a statically known size and allocates its contents in the heap
7272
|
7373
LL | f: Box<[u8]>,
7474
| ^^^^ ^
@@ -87,7 +87,7 @@ help: borrowed types always have a statically known size
8787
|
8888
LL | V1(&X, isize),
8989
| ^
90-
help: heap allocated types always have a statically known size
90+
help: the `Box` type always has a statically known size and allocates its contents in the heap
9191
|
9292
LL | V1(Box<X>, isize),
9393
| ^^^^ ^
@@ -106,7 +106,7 @@ help: borrowed types always have a statically known size
106106
|
107107
LL | V2{f1: &X, f: isize},
108108
| ^
109-
help: heap allocated types always have a statically known size
109+
help: the `Box` type always has a statically known size and allocates its contents in the heap
110110
|
111111
LL | V2{f1: Box<X>, f: isize},
112112
| ^^^^ ^

0 commit comments

Comments
 (0)