about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2020-07-14 12:18:01 -0700
committerEsteban Küber <esteban@kuber.com.ar>2020-07-14 12:19:50 -0700
commitff75395ca833a3ea4276d09f5cbe63be63a8c554 (patch)
treeb7c8824f3dc8b3a8fd5e17e07d368c0217159fbe /src
parentc38b127d8463b595b5df93f3b8c4462d39d7cd0b (diff)
downloadrust-ff75395ca833a3ea4276d09f5cbe63be63a8c554.tar.gz
rust-ff75395ca833a3ea4276d09f5cbe63be63a8c554.zip
Reword message
Diffstat (limited to 'src')
-rw-r--r--src/librustc_trait_selection/traits/error_reporting/suggestions.rs3
-rw-r--r--src/test/ui/issues/issue-27060-2.stderr2
-rw-r--r--src/test/ui/issues/issue-35988.stderr2
-rw-r--r--src/test/ui/union/union-sized-field.stderr6
-rw-r--r--src/test/ui/union/union-unsized.stderr4
-rw-r--r--src/test/ui/unsized/unsized-enum2.stderr40
-rw-r--r--src/test/ui/unsized5.stderr12
7 files changed, 35 insertions, 34 deletions
diff --git a/src/librustc_trait_selection/traits/error_reporting/suggestions.rs b/src/librustc_trait_selection/traits/error_reporting/suggestions.rs
index 9bcc2a885fe..2c6589eb2bd 100644
--- a/src/librustc_trait_selection/traits/error_reporting/suggestions.rs
+++ b/src/librustc_trait_selection/traits/error_reporting/suggestions.rs
@@ -1882,7 +1882,8 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
                     Applicability::MachineApplicable,
                 );
                 err.multipart_suggestion(
-                    "heap allocated types always have a statically known size",
+                    "the `Box` type always has a statically known size and allocates its contents \
+                     in the heap",
                     vec![
                         (span.shrink_to_lo(), "Box<".to_string()),
                         (span.shrink_to_hi(), ">".to_string()),
diff --git a/src/test/ui/issues/issue-27060-2.stderr b/src/test/ui/issues/issue-27060-2.stderr
index 96696fabd93..5dbcc96e874 100644
--- a/src/test/ui/issues/issue-27060-2.stderr
+++ b/src/test/ui/issues/issue-27060-2.stderr
@@ -12,7 +12,7 @@ help: borrowed types always have a statically known size
    |
 LL |     data: &T,
    |           ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     data: Box<T>,
    |           ^^^^ ^
diff --git a/src/test/ui/issues/issue-35988.stderr b/src/test/ui/issues/issue-35988.stderr
index a1375496938..0f0b80a9ff8 100644
--- a/src/test/ui/issues/issue-35988.stderr
+++ b/src/test/ui/issues/issue-35988.stderr
@@ -11,7 +11,7 @@ help: borrowed types always have a statically known size
    |
 LL |     V(&[Box<E>]),
    |       ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     V(Box<[Box<E>]>),
    |       ^^^^        ^
diff --git a/src/test/ui/union/union-sized-field.stderr b/src/test/ui/union/union-sized-field.stderr
index d7224e46add..b916bbe8ad1 100644
--- a/src/test/ui/union/union-sized-field.stderr
+++ b/src/test/ui/union/union-sized-field.stderr
@@ -12,7 +12,7 @@ help: borrowed types always have a statically known size
    |
 LL |     value: &T,
    |            ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     value: Box<T>,
    |            ^^^^ ^
@@ -31,7 +31,7 @@ help: borrowed types always have a statically known size
    |
 LL |     value: &T,
    |            ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     value: Box<T>,
    |            ^^^^ ^
@@ -50,7 +50,7 @@ help: borrowed types always have a statically known size
    |
 LL |     Value(&T),
    |           ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     Value(Box<T>),
    |           ^^^^ ^
diff --git a/src/test/ui/union/union-unsized.stderr b/src/test/ui/union/union-unsized.stderr
index 574f182ecc6..f62a3b4d14b 100644
--- a/src/test/ui/union/union-unsized.stderr
+++ b/src/test/ui/union/union-unsized.stderr
@@ -11,7 +11,7 @@ help: borrowed types always have a statically known size
    |
 LL |     a: &str,
    |        ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     a: Box<str>,
    |        ^^^^   ^
@@ -29,7 +29,7 @@ help: borrowed types always have a statically known size
    |
 LL |     b: &str,
    |        ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     b: Box<str>,
    |        ^^^^   ^
diff --git a/src/test/ui/unsized/unsized-enum2.stderr b/src/test/ui/unsized/unsized-enum2.stderr
index 742abc39209..988c3101676 100644
--- a/src/test/ui/unsized/unsized-enum2.stderr
+++ b/src/test/ui/unsized/unsized-enum2.stderr
@@ -13,7 +13,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VA(&W),
    |        ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VA(Box<W>),
    |        ^^^^ ^
@@ -33,7 +33,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VB{x: &X},
    |           ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VB{x: Box<X>},
    |           ^^^^ ^
@@ -53,7 +53,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VC(isize, &Y),
    |               ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VC(isize, Box<Y>),
    |               ^^^^ ^
@@ -73,7 +73,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VD{u: isize, x: &Z},
    |                     ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VD{u: isize, x: Box<Z>},
    |                     ^^^^ ^
@@ -91,7 +91,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VE(&[u8]),
    |        ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VE(Box<[u8]>),
    |        ^^^^    ^
@@ -109,7 +109,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VF{x: &str},
    |           ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VF{x: Box<str>},
    |           ^^^^   ^
@@ -127,7 +127,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VG(isize, &[f32]),
    |               ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VG(isize, Box<[f32]>),
    |               ^^^^     ^
@@ -145,7 +145,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VH{u: isize, x: &[u32]},
    |                     ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VH{u: isize, x: Box<[u32]>},
    |                     ^^^^     ^
@@ -163,7 +163,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VM(&dyn Foo),
    |        ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VM(Box<dyn Foo>),
    |        ^^^^       ^
@@ -181,7 +181,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VN{x: &dyn Bar},
    |           ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VN{x: Box<dyn Bar>},
    |           ^^^^       ^
@@ -199,7 +199,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VO(isize, &dyn FooBar),
    |               ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VO(isize, Box<dyn FooBar>),
    |               ^^^^          ^
@@ -217,7 +217,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VP{u: isize, x: &dyn BarFoo},
    |                     ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VP{u: isize, x: Box<dyn BarFoo>},
    |                     ^^^^          ^
@@ -235,7 +235,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VQ(&<&'static [i8] as Deref>::Target),
    |        ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VQ(Box<<&'static [i8] as Deref>::Target>),
    |        ^^^^                                ^
@@ -253,7 +253,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VR{x: &<&'static [char] as Deref>::Target},
    |           ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VR{x: Box<<&'static [char] as Deref>::Target>},
    |           ^^^^                                  ^
@@ -271,7 +271,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VS(isize, &<&'static [f64] as Deref>::Target),
    |               ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VS(isize, Box<<&'static [f64] as Deref>::Target>),
    |               ^^^^                                 ^
@@ -289,7 +289,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VT{u: isize, x: &<&'static [i32] as Deref>::Target},
    |                     ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VT{u: isize, x: Box<<&'static [i32] as Deref>::Target>},
    |                     ^^^^                                 ^
@@ -308,7 +308,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VI(&Path1),
    |        ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VI(Box<Path1>),
    |        ^^^^     ^
@@ -327,7 +327,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VJ{x: &Path2},
    |           ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VJ{x: Box<Path2>},
    |           ^^^^     ^
@@ -346,7 +346,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VK(isize, &Path3),
    |               ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VK(isize, Box<Path3>),
    |               ^^^^     ^
@@ -365,7 +365,7 @@ help: borrowed types always have a statically known size
    |
 LL |     VL{u: isize, x: &Path4},
    |                     ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     VL{u: isize, x: Box<Path4>},
    |                     ^^^^     ^
diff --git a/src/test/ui/unsized5.stderr b/src/test/ui/unsized5.stderr
index 80cf4baeab7..3fd0b429bec 100644
--- a/src/test/ui/unsized5.stderr
+++ b/src/test/ui/unsized5.stderr
@@ -12,7 +12,7 @@ help: borrowed types always have a statically known size
    |
 LL |     f1: &X,
    |         ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     f1: Box<X>,
    |         ^^^^ ^
@@ -32,7 +32,7 @@ help: borrowed types always have a statically known size
    |
 LL |     g: &X,
    |        ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     g: Box<X>,
    |        ^^^^ ^
@@ -50,7 +50,7 @@ help: borrowed types always have a statically known size
    |
 LL |     f: &str,
    |        ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     f: Box<str>,
    |        ^^^^   ^
@@ -68,7 +68,7 @@ help: borrowed types always have a statically known size
    |
 LL |     f: &[u8],
    |        ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     f: Box<[u8]>,
    |        ^^^^    ^
@@ -87,7 +87,7 @@ help: borrowed types always have a statically known size
    |
 LL |     V1(&X, isize),
    |        ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     V1(Box<X>, isize),
    |        ^^^^ ^
@@ -106,7 +106,7 @@ help: borrowed types always have a statically known size
    |
 LL |     V2{f1: &X, f: isize},
    |            ^
-help: heap allocated types always have a statically known size
+help: the `Box` type always has a statically known size and allocates its contents in the heap
    |
 LL |     V2{f1: Box<X>, f: isize},
    |            ^^^^ ^