diff options
| author | Michael Goulet <michael@errs.io> | 2025-01-30 04:23:14 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-02-03 19:00:22 +0000 |
| commit | 23ab0f2cdc1f2563e258f29c37741154a2f084d6 (patch) | |
| tree | 906def284f7018d499c29cf68f128fb8f4bec825 /tests/ui/statics | |
| parent | f2c4ccd852f68fb36dedc033239cb7c0fb1921ef (diff) | |
| download | rust-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.stderr | 14 |
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 |
