2020-02-15 06:13:20 -06:00
|
|
|
error: the type `&T` does not permit zero-initialization
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:40:32
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
2019-08-07 01:42:50 -05:00
|
|
|
LL | let _val: &'static T = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
2020-01-22 17:57:38 -06:00
|
|
|
note: the lint level is defined here
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:6:9
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
|
|
|
LL | #![deny(invalid_value)]
|
|
|
|
| ^^^^^^^^^^^^^
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: references must be non-null
|
2019-08-07 01:42:50 -05:00
|
|
|
|
2020-02-15 06:13:20 -06:00
|
|
|
error: the type `&T` does not permit being left uninitialized
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:41:32
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
|
LL | let _val: &'static T = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: references must be non-null
|
2019-08-07 01:42:50 -05:00
|
|
|
|
2020-02-15 06:13:20 -06:00
|
|
|
error: the type `Wrap<&T>` does not permit zero-initialization
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:43:38
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
|
LL | let _val: Wrap<&'static T> = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: references must be non-null (in this struct field)
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:17:18
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
|
|
|
LL | struct Wrap<T> { wrapped: T }
|
|
|
|
| ^^^^^^^^^^
|
2019-08-07 01:42:50 -05:00
|
|
|
|
2020-02-15 06:13:20 -06:00
|
|
|
error: the type `Wrap<&T>` does not permit being left uninitialized
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:44:38
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
|
LL | let _val: Wrap<&'static T> = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: references must be non-null (in this struct field)
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:17:18
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05:00
|
|
|
LL | struct Wrap<T> { wrapped: T }
|
|
|
|
| ^^^^^^^^^^
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `!` does not permit zero-initialization
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:51:23
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
|
LL | let _val: ! = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: the `!` type has no valid value
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
|
|
error: the type `!` does not permit being left uninitialized
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:52:23
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
|
|
|
LL | let _val: ! = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: the `!` type has no valid value
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `(i32, !)` does not permit zero-initialization
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:54:30
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
|
LL | let _val: (i32, !) = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: the `!` type has no valid value
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `(i32, !)` does not permit being left uninitialized
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:55:30
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
|
LL | let _val: (i32, !) = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: the `!` type has no valid value
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `Void` does not permit zero-initialization
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:57:26
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
|
LL | let _val: Void = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2020-01-10 08:57:36 -06:00
|
|
|
= note: enums with no variants have no valid value
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `Void` does not permit being left uninitialized
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:58:26
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
|
LL | let _val: Void = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2020-01-10 08:57:36 -06:00
|
|
|
= note: enums with no variants have no valid value
|
2019-08-06 16:11:52 -05:00
|
|
|
|
2020-02-15 06:13:20 -06:00
|
|
|
error: the type `&i32` does not permit zero-initialization
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:60:34
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
|
|
|
LL | let _val: &'static i32 = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: references must be non-null
|
2019-08-06 16:11:52 -05:00
|
|
|
|
2020-02-15 06:13:20 -06:00
|
|
|
error: the type `&i32` does not permit being left uninitialized
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:61:34
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
|
|
|
LL | let _val: &'static i32 = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: references must be non-null
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `Ref` does not permit zero-initialization
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:63:25
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
|
LL | let _val: Ref = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: references must be non-null (in this struct field)
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:14:12
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05:00
|
|
|
LL | struct Ref(&'static i32);
|
|
|
|
| ^^^^^^^^^^^^
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `Ref` does not permit being left uninitialized
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:64:25
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
|
LL | let _val: Ref = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: references must be non-null (in this struct field)
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:14:12
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
|
|
|
LL | struct Ref(&'static i32);
|
|
|
|
| ^^^^^^^^^^^^
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
|
|
error: the type `fn()` does not permit zero-initialization
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:66:26
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
|
|
|
LL | let _val: fn() = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: function pointers must be non-null
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
|
|
error: the type `fn()` does not permit being left uninitialized
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:67:26
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
|
|
|
LL | let _val: fn() = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: function pointers must be non-null
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `Wrap<fn()>` does not permit zero-initialization
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:69:32
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
|
LL | let _val: Wrap<fn()> = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: function pointers must be non-null (in this struct field)
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:17:18
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05:00
|
|
|
LL | struct Wrap<T> { wrapped: T }
|
|
|
|
| ^^^^^^^^^^
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `Wrap<fn()>` does not permit being left uninitialized
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:70:32
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
|
LL | let _val: Wrap<fn()> = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: function pointers must be non-null (in this struct field)
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:17:18
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
|
|
|
LL | struct Wrap<T> { wrapped: T }
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: the type `WrapEnum<fn()>` does not permit zero-initialization
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:72:36
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
|
|
|
LL | let _val: WrapEnum<fn()> = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: function pointers must be non-null (in this enum field)
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:18:28
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
|
|
|
LL | enum WrapEnum<T> { Wrapped(T) }
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: the type `WrapEnum<fn()>` does not permit being left uninitialized
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:73:36
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
|
|
|
LL | let _val: WrapEnum<fn()> = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: function pointers must be non-null (in this enum field)
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:18:28
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
|
|
|
LL | enum WrapEnum<T> { Wrapped(T) }
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: the type `Wrap<(RefPair, i32)>` does not permit zero-initialization
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:75:42
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
|
|
|
LL | let _val: Wrap<(RefPair, i32)> = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: references must be non-null (in this struct field)
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:15:16
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
|
|
|
LL | struct RefPair((&'static i32, i32));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: the type `Wrap<(RefPair, i32)>` does not permit being left uninitialized
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:76:42
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
|
|
|
LL | let _val: Wrap<(RefPair, i32)> = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: references must be non-null (in this struct field)
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:15:16
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05:00
|
|
|
LL | struct RefPair((&'static i32, i32));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
2019-08-06 16:11:52 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error: the type `NonNull<i32>` does not permit zero-initialization
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:78:34
|
2019-08-17 03:13:47 -05:00
|
|
|
|
|
2019-08-17 15:11:43 -05:00
|
|
|
LL | let _val: NonNull<i32> = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-17 03:13:47 -05:00
|
|
|
|
|
2020-09-03 06:33:55 -05:00
|
|
|
= note: `std::ptr::NonNull<i32>` must be non-null
|
2019-08-17 03:13:47 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error: the type `NonNull<i32>` does not permit being left uninitialized
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:79:34
|
2019-08-17 03:13:47 -05:00
|
|
|
|
|
2019-08-17 15:11:43 -05:00
|
|
|
LL | let _val: NonNull<i32> = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-17 03:13:47 -05:00
|
|
|
|
|
2020-09-03 06:33:55 -05:00
|
|
|
= note: `std::ptr::NonNull<i32>` must be non-null
|
2019-08-17 03:13:47 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error: the type `*const dyn Send` does not permit zero-initialization
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:81:37
|
2019-11-02 05:56:06 -05:00
|
|
|
|
|
|
|
|
LL | let _val: *const dyn Send = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-11-02 05:56:06 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: the vtable of a wide raw pointer must be non-null
|
2019-11-02 05:56:06 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error: the type `*const dyn Send` does not permit being left uninitialized
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:82:37
|
2019-11-02 05:56:06 -05:00
|
|
|
|
|
|
|
|
LL | let _val: *const dyn Send = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-11-02 05:56:06 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: the vtable of a wide raw pointer must be non-null
|
2019-11-02 05:56:06 -05:00
|
|
|
|
2022-03-27 12:10:34 -05:00
|
|
|
error: the type `[fn(); 2]` does not permit zero-initialization
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:84:31
|
|
|
|
|
|
|
|
|
LL | let _val: [fn(); 2] = 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
|
|
|
|
|
|
|
|
error: the type `[fn(); 2]` does not permit being left uninitialized
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:85:31
|
|
|
|
|
|
|
|
|
LL | let _val: [fn(); 2] = 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
|
|
|
|
|
2019-08-17 02:39:25 -05:00
|
|
|
error: the type `bool` does not permit being left uninitialized
|
2022-03-27 12:10:34 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:89:26
|
2019-08-17 02:39:25 -05:00
|
|
|
|
|
|
|
|
LL | let _val: bool = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-17 02:39:25 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: booleans must be either `true` or `false`
|
2019-08-17 02:39:25 -05:00
|
|
|
|
|
|
|
error: the type `Wrap<char>` does not permit being left uninitialized
|
2022-03-27 12:10:34 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:92:32
|
2019-08-17 02:39:25 -05:00
|
|
|
|
|
|
|
|
LL | let _val: Wrap<char> = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-17 02:39:25 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
note: characters must be a valid Unicode codepoint (in this struct field)
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:17:18
|
2019-08-17 02:39:25 -05:00
|
|
|
|
|
|
|
|
LL | struct Wrap<T> { wrapped: T }
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2019-08-17 03:13:47 -05:00
|
|
|
error: the type `NonBig` does not permit being left uninitialized
|
2022-03-27 12:10:34 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:95:28
|
2019-08-17 03:13:47 -05:00
|
|
|
|
|
|
|
|
LL | let _val: NonBig = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-17 03:13:47 -05:00
|
|
|
|
|
2020-01-10 08:57:36 -06:00
|
|
|
= note: `NonBig` must be initialized inside its custom valid range
|
2019-08-17 03:13:47 -05:00
|
|
|
|
2020-07-17 08:01:37 -05:00
|
|
|
error: the type `Fruit` does not permit being left uninitialized
|
2022-03-27 12:10:34 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:98:27
|
2020-07-17 08:01:37 -05:00
|
|
|
|
|
|
|
|
LL | let _val: Fruit = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
|
|
|
|
|
|
|
|
note: enums have to be initialized to a variant
|
2021-04-03 06:05:11 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:26:1
|
2020-07-17 08:01:37 -05:00
|
|
|
|
|
|
|
|
LL | / enum Fruit {
|
|
|
|
LL | | Apple,
|
|
|
|
LL | | Banana,
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
2022-03-27 12:10:34 -05:00
|
|
|
error: the type `[bool; 2]` does not permit being left uninitialized
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:101:31
|
|
|
|
|
|
|
|
|
LL | let _val: [bool; 2] = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
|
|
|
|
|
|
|
|
= note: booleans must be either `true` or `false`
|
|
|
|
|
2020-02-15 06:13:20 -06:00
|
|
|
error: the type `&i32` does not permit zero-initialization
|
2022-03-27 12:10:34 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:104:34
|
2019-08-17 04:48:30 -05:00
|
|
|
|
|
|
|
|
LL | let _val: &'static i32 = mem::transmute(0usize);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-17 04:48:30 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: references must be non-null
|
2019-08-17 04:48:30 -05:00
|
|
|
|
2020-02-15 06:13:20 -06:00
|
|
|
error: the type `&[i32]` does not permit zero-initialization
|
2022-03-27 12:10:34 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:105:36
|
2019-08-17 04:48:30 -05:00
|
|
|
|
|
|
|
|
LL | let _val: &'static [i32] = mem::transmute((0usize, 0usize));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-17 04:48:30 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: references must be non-null
|
2019-08-17 04:48:30 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error: the type `NonZeroU32` does not permit zero-initialization
|
2022-03-27 12:10:34 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:106:32
|
2019-08-17 04:48:30 -05:00
|
|
|
|
|
|
|
|
LL | let _val: NonZeroU32 = mem::transmute(0);
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-08-17 04:48:30 -05:00
|
|
|
|
|
2020-09-03 06:33:55 -05:00
|
|
|
= note: `std::num::NonZeroU32` must be non-null
|
2019-08-17 04:48:30 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error: the type `NonNull<i32>` does not permit zero-initialization
|
2022-03-27 12:10:34 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:109:34
|
2019-11-02 10:12:33 -05:00
|
|
|
|
|
|
|
|
LL | let _val: NonNull<i32> = MaybeUninit::zeroed().assume_init();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-11-02 10:12:33 -05:00
|
|
|
|
|
2020-09-03 06:33:55 -05:00
|
|
|
= note: `std::ptr::NonNull<i32>` must be non-null
|
2019-11-02 10:12:33 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error: the type `NonNull<i32>` does not permit being left uninitialized
|
2022-03-27 12:10:34 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:110:34
|
2019-11-02 10:12:33 -05:00
|
|
|
|
|
|
|
|
LL | let _val: NonNull<i32> = MaybeUninit::uninit().assume_init();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-11-02 10:12:33 -05:00
|
|
|
|
|
2020-09-03 06:33:55 -05:00
|
|
|
= note: `std::ptr::NonNull<i32>` must be non-null
|
2019-11-02 10:12:33 -05:00
|
|
|
|
|
|
|
error: the type `bool` does not permit being left uninitialized
|
2022-03-27 12:10:34 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:111:26
|
2019-11-02 10:12:33 -05:00
|
|
|
|
|
|
|
|
LL | let _val: bool = MaybeUninit::uninit().assume_init();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
2019-11-07 03:22:50 -06:00
|
|
|
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
2019-11-02 10:12:33 -05:00
|
|
|
|
|
2020-01-10 08:13:05 -06:00
|
|
|
= note: booleans must be either `true` or `false`
|
2019-11-02 10:12:33 -05:00
|
|
|
|
2022-03-27 12:10:34 -05:00
|
|
|
error: aborting due to 39 previous errors
|
2019-08-06 16:11:52 -05:00
|
|
|
|