about summary refs log tree commit diff
path: root/tests/ui/statics
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-01-30 04:23:14 +0000
committerMichael Goulet <michael@errs.io>2025-02-03 19:00:22 +0000
commit23ab0f2cdc1f2563e258f29c37741154a2f084d6 (patch)
tree906def284f7018d499c29cf68f128fb8f4bec825 /tests/ui/statics
parentf2c4ccd852f68fb36dedc033239cb7c0fb1921ef (diff)
downloadrust-23ab0f2cdc1f2563e258f29c37741154a2f084d6.tar.gz
rust-23ab0f2cdc1f2563e258f29c37741154a2f084d6.zip
Check Sizedness of return type in WF
Diffstat (limited to 'tests/ui/statics')
-rw-r--r--tests/ui/statics/unsized_type2.stderr14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/ui/statics/unsized_type2.stderr b/tests/ui/statics/unsized_type2.stderr
index b18a99fab72..ffbbe218c87 100644
--- a/tests/ui/statics/unsized_type2.stderr
+++ b/tests/ui/statics/unsized_type2.stderr
@@ -11,6 +11,12 @@ note: required because it appears within the type `Foo`
 LL | pub struct Foo {
    |            ^^^
 
+error[E0308]: mismatched types
+  --> $DIR/unsized_type2.rs:14:45
+   |
+LL | pub static WITH_ERROR: Foo = Foo { version: 0 };
+   |                                             ^ expected `str`, found integer
+
 error[E0277]: the size for values of type `str` cannot be known at compilation time
   --> $DIR/unsized_type2.rs:14:30
    |
@@ -23,13 +29,7 @@ note: required because it appears within the type `Foo`
    |
 LL | pub struct Foo {
    |            ^^^
-   = note: constant expressions must have a statically known size
-
-error[E0308]: mismatched types
-  --> $DIR/unsized_type2.rs:14:45
-   |
-LL | pub static WITH_ERROR: Foo = Foo { version: 0 };
-   |                                             ^ expected `str`, found integer
+   = note: structs must have a statically known size to be initialized
 
 error: aborting due to 3 previous errors