2019-08-07 01:42:50 -05:00
|
|
|
error: the type `&'static T` does not permit zero-initialization
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:27: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
|
|
|
note: lint level defined here
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:7:9
|
|
|
|
|
|
|
|
|
LL | #![deny(invalid_value)]
|
|
|
|
| ^^^^^^^^^^^^^
|
2019-08-12 02:24:13 -05:00
|
|
|
= note: References must be non-null
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `&'static T` does not permit being left uninitialized
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:28: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05:00
|
|
|
= note: References must be non-null
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `Wrap<&'static T>` does not permit zero-initialization
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:30: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05:00
|
|
|
note: References must be non-null (in this struct field)
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:16:18
|
|
|
|
|
|
|
|
|
LL | struct Wrap<T> { wrapped: T }
|
|
|
|
| ^^^^^^^^^^
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `Wrap<&'static T>` does not permit being left uninitialized
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:31: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
|
|
|
|
|
|
|
|
note: References must be non-null (in this struct field)
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:16: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
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:38: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05:00
|
|
|
= note: The never type (`!`) has no valid value
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
|
|
error: the type `!` does not permit being left uninitialized
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:39: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05:00
|
|
|
= note: The never type (`!`) has no valid value
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `(i32, !)` does not permit zero-initialization
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:41: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05:00
|
|
|
= note: The never type (`!`) has no valid value
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `(i32, !)` does not permit being left uninitialized
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:42: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05:00
|
|
|
= note: The never type (`!`) has no valid value
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `Void` does not permit zero-initialization
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:44: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05:00
|
|
|
= note: 0-variant enums have no valid value
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `Void` does not permit being left uninitialized
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:45: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05:00
|
|
|
= note: 0-variant enums have no valid value
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
|
|
error: the type `&'static i32` does not permit zero-initialization
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:47: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05:00
|
|
|
= note: References must be non-null
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
|
|
error: the type `&'static i32` does not permit being left uninitialized
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:48: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05:00
|
|
|
= note: References must be non-null
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
|
|
error: the type `Ref` does not permit zero-initialization
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:50: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
|
|
|
|
|
|
|
|
note: References must be non-null (in this struct field)
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:13: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
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:51: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05:00
|
|
|
note: References must be non-null (in this struct field)
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:13:12
|
|
|
|
|
|
|
|
|
LL | struct Ref(&'static i32);
|
|
|
|
| ^^^^^^^^^^^^
|
2019-08-06 16:11:52 -05:00
|
|
|
|
|
|
|
error: the type `fn()` does not permit zero-initialization
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:53: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05: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
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:54: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
2019-08-07 01:42:50 -05:00
|
|
|
|
|
2019-08-12 02:24:13 -05: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
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:56: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
|
|
|
|
|
|
|
|
note: Function pointers must be non-null (in this struct field)
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:16: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
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:57: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
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
|
|
|
|
|
|
|
|
note: Function pointers must be non-null (in this struct field)
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:16:18
|
|
|
|
|
|
|
|
|
LL | struct Wrap<T> { wrapped: T }
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: the type `WrapEnum<fn()>` does not permit zero-initialization
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:59:36
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
|
|
|
LL | let _val: WrapEnum<fn()> = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
|
|
|
|
|
|
|
|
note: Function pointers must be non-null (in this enum field)
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:17:28
|
|
|
|
|
|
|
|
|
LL | enum WrapEnum<T> { Wrapped(T) }
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: the type `WrapEnum<fn()>` does not permit being left uninitialized
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:60:36
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
|
|
|
LL | let _val: WrapEnum<fn()> = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
|
|
|
|
|
|
|
|
note: Function pointers must be non-null (in this enum field)
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:17:28
|
|
|
|
|
|
|
|
|
LL | enum WrapEnum<T> { Wrapped(T) }
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: the type `Wrap<(RefPair, i32)>` does not permit zero-initialization
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:62:42
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
|
|
|
LL | let _val: Wrap<(RefPair, i32)> = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
|
|
|
|
|
|
|
|
note: References must be non-null (in this struct field)
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:14:16
|
|
|
|
|
|
|
|
|
LL | struct RefPair((&'static i32, i32));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: the type `Wrap<(RefPair, i32)>` does not permit being left uninitialized
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:63:42
|
2019-08-12 02:24:13 -05:00
|
|
|
|
|
|
|
|
LL | let _val: Wrap<(RefPair, i32)> = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
|
|
|
|
|
|
|
|
note: References must be non-null (in this struct field)
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:14: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
|
|
|
|
2019-08-17 03:13:47 -05:00
|
|
|
error: the type `std::vec::Vec<i32>` does not permit zero-initialization
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:65:30
|
|
|
|
|
|
|
|
|
LL | let _val: Vec<i32> = mem::zeroed();
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
|
|
|
|
|
|
|
|
note: std::ptr::Unique<i32> must be non-null (in this struct field)
|
|
|
|
--> $SRC_DIR/liballoc/raw_vec.rs:LL:COL
|
|
|
|
|
|
|
|
|
LL | ptr: Unique<T>,
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: the type `std::vec::Vec<i32>` does not permit being left uninitialized
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:66:30
|
|
|
|
|
|
|
|
|
LL | let _val: Vec<i32> = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
|
|
|
|
|
|
|
|
note: std::ptr::Unique<i32> must be non-null (in this struct field)
|
|
|
|
--> $SRC_DIR/liballoc/raw_vec.rs:LL:COL
|
|
|
|
|
|
|
|
|
LL | ptr: Unique<T>,
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
2019-08-17 02:39:25 -05:00
|
|
|
error: the type `bool` does not permit being left uninitialized
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:70:26
|
2019-08-17 02:39:25 -05:00
|
|
|
|
|
|
|
|
LL | let _val: bool = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
|
|
|
|
|
|
|
|
= note: Booleans must be `true` or `false`
|
|
|
|
|
|
|
|
error: the type `Wrap<char>` does not permit being left uninitialized
|
2019-08-17 03:13:47 -05:00
|
|
|
--> $DIR/uninitialized-zeroed.rs:73:32
|
2019-08-17 02:39:25 -05:00
|
|
|
|
|
|
|
|
LL | let _val: Wrap<char> = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
|
|
|
|
|
|
|
|
note: Characters must be a valid unicode codepoint (in this struct field)
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:16:18
|
|
|
|
|
|
|
|
|
LL | struct Wrap<T> { wrapped: T }
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2019-08-17 03:13:47 -05:00
|
|
|
error: the type `NonBig` does not permit being left uninitialized
|
|
|
|
--> $DIR/uninitialized-zeroed.rs:76:28
|
|
|
|
|
|
|
|
|
LL | let _val: NonBig = mem::uninitialized();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| this code causes undefined behavior when executed
|
|
|
|
| help: use `MaybeUninit<T>` instead
|
|
|
|
|
|
|
|
|
= note: NonBig must be initialized inside its custom valid range
|
|
|
|
|
|
|
|
error: aborting due to 27 previous errors
|
2019-08-06 16:11:52 -05:00
|
|
|
|