summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lint/invalid_value.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/lint/invalid_value.stderr')
-rw-r--r--src/test/ui/lint/invalid_value.stderr69
1 files changed, 52 insertions, 17 deletions
diff --git a/src/test/ui/lint/invalid_value.stderr b/src/test/ui/lint/invalid_value.stderr
index 76afb765f..5370660d6 100644
--- a/src/test/ui/lint/invalid_value.stderr
+++ b/src/test/ui/lint/invalid_value.stderr
@@ -34,7 +34,8 @@ LL | let _val: Wrap<&'static T> = mem::zeroed();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: references must be non-null (in this struct field)
+ = note: `Wrap<&T>` must be non-null
+note: because references must be non-null (in this struct field)
--> $DIR/invalid_value.rs:17:18
|
LL | struct Wrap<T> { wrapped: T }
@@ -49,7 +50,8 @@ LL | let _val: Wrap<&'static T> = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: references must be non-null (in this struct field)
+ = note: `Wrap<&T>` must be non-null
+note: because references must be non-null (in this struct field)
--> $DIR/invalid_value.rs:17:18
|
LL | struct Wrap<T> { wrapped: T }
@@ -97,7 +99,7 @@ LL | let _val: (i32, !) = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
- = note: integers must not be uninitialized
+ = note: integers must be initialized
error: the type `Void` does not permit zero-initialization
--> $DIR/invalid_value.rs:71:26
@@ -160,7 +162,8 @@ LL | let _val: Ref = mem::zeroed();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: references must be non-null (in this struct field)
+ = note: `Ref` must be non-null
+note: because references must be non-null (in this struct field)
--> $DIR/invalid_value.rs:14:12
|
LL | struct Ref(&'static i32);
@@ -175,7 +178,8 @@ LL | let _val: Ref = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: references must be non-null (in this struct field)
+ = note: `Ref` must be non-null
+note: because references must be non-null (in this struct field)
--> $DIR/invalid_value.rs:14:12
|
LL | struct Ref(&'static i32);
@@ -212,7 +216,8 @@ LL | let _val: Wrap<fn()> = mem::zeroed();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: function pointers must be non-null (in this struct field)
+ = note: `Wrap<fn()>` must be non-null
+note: because function pointers must be non-null (in this struct field)
--> $DIR/invalid_value.rs:17:18
|
LL | struct Wrap<T> { wrapped: T }
@@ -227,7 +232,8 @@ LL | let _val: Wrap<fn()> = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: function pointers must be non-null (in this struct field)
+ = note: `Wrap<fn()>` must be non-null
+note: because function pointers must be non-null (in this struct field)
--> $DIR/invalid_value.rs:17:18
|
LL | struct Wrap<T> { wrapped: T }
@@ -242,7 +248,8 @@ LL | let _val: WrapEnum<fn()> = mem::zeroed();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: function pointers must be non-null (in this field of the only potentially inhabited enum variant)
+ = note: `WrapEnum<fn()>` must be non-null
+note: because function pointers must be non-null (in this field of the only potentially inhabited enum variant)
--> $DIR/invalid_value.rs:18:28
|
LL | enum WrapEnum<T> { Wrapped(T) }
@@ -257,7 +264,8 @@ LL | let _val: WrapEnum<fn()> = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: function pointers must be non-null (in this field of the only potentially inhabited enum variant)
+ = note: `WrapEnum<fn()>` must be non-null
+note: because function pointers must be non-null (in this field of the only potentially inhabited enum variant)
--> $DIR/invalid_value.rs:18:28
|
LL | enum WrapEnum<T> { Wrapped(T) }
@@ -272,7 +280,12 @@ LL | let _val: Wrap<(RefPair, i32)> = mem::zeroed();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: references must be non-null (in this struct field)
+note: `RefPair` must be non-null (in this struct field)
+ --> $DIR/invalid_value.rs:17:18
+ |
+LL | struct Wrap<T> { wrapped: T }
+ | ^^^^^^^^^^
+note: because references must be non-null (in this struct field)
--> $DIR/invalid_value.rs:15:16
|
LL | struct RefPair((&'static i32, i32));
@@ -287,7 +300,12 @@ LL | let _val: Wrap<(RefPair, i32)> = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: references must be non-null (in this struct field)
+note: `RefPair` must be non-null (in this struct field)
+ --> $DIR/invalid_value.rs:17:18
+ |
+LL | struct Wrap<T> { wrapped: T }
+ | ^^^^^^^^^^
+note: because references must be non-null (in this struct field)
--> $DIR/invalid_value.rs:15:16
|
LL | struct RefPair((&'static i32, i32));
@@ -314,6 +332,7 @@ LL | let _val: NonNull<i32> = mem::uninitialized();
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
= note: `std::ptr::NonNull<i32>` must be non-null
+ = note: raw pointers must be initialized
error: the type `(NonZeroU32, i32)` does not permit zero-initialization
--> $DIR/invalid_value.rs:95:39
@@ -336,6 +355,7 @@ LL | let _val: (NonZeroU32, i32) = mem::uninitialized();
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
= note: `std::num::NonZeroU32` must be non-null
+ = note: integers must be initialized
error: the type `*const dyn Send` does not permit zero-initialization
--> $DIR/invalid_value.rs:98:37
@@ -420,7 +440,8 @@ LL | let _val: OneFruitNonZero = mem::zeroed();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: `std::num::NonZeroU32` must be non-null (in this field of the only potentially inhabited enum variant)
+ = note: `OneFruitNonZero` must be non-null
+note: because `std::num::NonZeroU32` must be non-null (in this field of the only potentially inhabited enum variant)
--> $DIR/invalid_value.rs:39:12
|
LL | Banana(NonZeroU32),
@@ -435,11 +456,13 @@ LL | let _val: OneFruitNonZero = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: `std::num::NonZeroU32` must be non-null (in this field of the only potentially inhabited enum variant)
+ = note: `OneFruitNonZero` must be non-null
+note: because `std::num::NonZeroU32` must be non-null (in this field of the only potentially inhabited enum variant)
--> $DIR/invalid_value.rs:39:12
|
LL | Banana(NonZeroU32),
| ^^^^^^^^^^
+ = note: integers must be initialized
error: the type `bool` does not permit being left uninitialized
--> $DIR/invalid_value.rs:112:26
@@ -461,6 +484,7 @@ LL | let _val: Wrap<char> = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
+ = note: `Wrap<char>` must be initialized inside its custom valid range
note: characters must be a valid Unicode codepoint (in this struct field)
--> $DIR/invalid_value.rs:17:18
|
@@ -477,6 +501,11 @@ LL | let _val: NonBig = mem::uninitialized();
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
= note: `NonBig` must be initialized inside its custom valid range
+note: integers must be initialized (in this struct field)
+ --> $DIR/invalid_value.rs:23:26
+ |
+LL | pub(crate) struct NonBig(u64);
+ | ^^^
error: the type `Fruit` does not permit being left uninitialized
--> $DIR/invalid_value.rs:121:27
@@ -513,7 +542,7 @@ LL | let _val: i32 = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
- = note: integers must not be uninitialized
+ = note: integers must be initialized
error: the type `f32` does not permit being left uninitialized
--> $DIR/invalid_value.rs:130:25
@@ -524,7 +553,7 @@ LL | let _val: f32 = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
- = note: floats must not be uninitialized
+ = note: floats must be initialized
error: the type `*const ()` does not permit being left uninitialized
--> $DIR/invalid_value.rs:133:31
@@ -535,7 +564,7 @@ LL | let _val: *const () = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
- = note: raw pointers must not be uninitialized
+ = note: raw pointers must be initialized
error: the type `*const [()]` does not permit being left uninitialized
--> $DIR/invalid_value.rs:136:33
@@ -546,7 +575,7 @@ LL | let _val: *const [()] = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
- = note: raw pointers must not be uninitialized
+ = note: raw pointers must be initialized
error: the type `WrapAroundRange` does not permit being left uninitialized
--> $DIR/invalid_value.rs:139:37
@@ -558,6 +587,11 @@ LL | let _val: WrapAroundRange = mem::uninitialized();
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
= note: `WrapAroundRange` must be initialized inside its custom valid range
+note: integers must be initialized (in this struct field)
+ --> $DIR/invalid_value.rs:49:35
+ |
+LL | pub(crate) struct WrapAroundRange(u8);
+ | ^^
error: the type `Result<i32, i32>` does not permit being left uninitialized
--> $DIR/invalid_value.rs:144:38
@@ -628,6 +662,7 @@ LL | let _val: NonNull<i32> = MaybeUninit::uninit().assume_init();
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
= note: `std::ptr::NonNull<i32>` must be non-null
+ = note: raw pointers must be initialized
error: the type `bool` does not permit being left uninitialized
--> $DIR/invalid_value.rs:159:26