rust/tests/ui/borrowck/borrowck-uninit-ref-chain.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

83 lines
3.1 KiB
Plaintext
Raw Normal View History

2022-06-23 17:42:17 +00:00
error[E0381]: used binding `x` isn't initialized
--> $DIR/borrowck-uninit-ref-chain.rs:8:14
2018-08-08 12:28:26 +00:00
|
LL | let x: &&Box<i32>;
2022-06-21 22:54:17 +00:00
| - binding declared here but left uninitialized
LL | let _y = &**x;
2022-06-21 22:54:17 +00:00
| ^^^^ `**x` used here but it isn't initialized
|
help: consider assigning a value
|
LL | let x: &&Box<i32> = todo!();
| +++++++++
2018-08-08 12:28:26 +00:00
2022-06-23 17:42:17 +00:00
error[E0381]: used binding `x` isn't initialized
--> $DIR/borrowck-uninit-ref-chain.rs:11:14
2018-08-08 12:28:26 +00:00
|
LL | let x: &&S<i32, i32>;
2022-06-21 22:54:17 +00:00
| - binding declared here but left uninitialized
LL | let _y = &**x;
2022-06-21 22:54:17 +00:00
| ^^^^ `**x` used here but it isn't initialized
|
help: consider assigning a value
|
LL | let x: &&S<i32, i32> = todo!();
| +++++++++
2018-08-08 12:28:26 +00:00
2022-06-23 17:42:17 +00:00
error[E0381]: used binding `x` isn't initialized
--> $DIR/borrowck-uninit-ref-chain.rs:14:14
2018-08-08 12:28:26 +00:00
|
LL | let x: &&i32;
2022-06-21 22:54:17 +00:00
| - binding declared here but left uninitialized
LL | let _y = &**x;
2022-06-21 22:54:17 +00:00
| ^^^^ `**x` used here but it isn't initialized
|
help: consider assigning a value
|
LL | let x: &&i32 = todo!();
| +++++++++
2018-08-08 12:28:26 +00:00
2022-06-21 22:54:17 +00:00
error[E0381]: partially assigned binding `a` isn't fully initialized
--> $DIR/borrowck-uninit-ref-chain.rs:18:5
2018-08-08 12:28:26 +00:00
|
LL | let mut a: S<i32, i32>;
2022-06-21 22:54:17 +00:00
| ----- binding declared here but left uninitialized
LL | a.x = 0;
| ^^^^^^^ `a` partially assigned here but it isn't fully initialized
|
2022-06-21 22:54:17 +00:00
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
2018-08-08 12:28:26 +00:00
2022-06-21 22:54:17 +00:00
error[E0381]: partially assigned binding `a` isn't fully initialized
--> $DIR/borrowck-uninit-ref-chain.rs:22:5
2018-08-08 12:28:26 +00:00
|
LL | let mut a: S<&&i32, &&i32>;
2022-06-21 22:54:17 +00:00
| ----- binding declared here but left uninitialized
LL | a.x = &&0;
| ^^^^^^^^^ `a` partially assigned here but it isn't fully initialized
|
2022-06-21 22:54:17 +00:00
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
2018-08-08 12:28:26 +00:00
2022-06-21 22:54:17 +00:00
error[E0381]: partially assigned binding `a` isn't fully initialized
--> $DIR/borrowck-uninit-ref-chain.rs:27:5
2018-10-16 15:08:59 +00:00
|
LL | let mut a: S<i32, i32>;
2022-06-21 22:54:17 +00:00
| ----- binding declared here but left uninitialized
LL | a.x = 0;
| ^^^^^^^ `a` partially assigned here but it isn't fully initialized
|
2022-06-21 22:54:17 +00:00
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
2018-10-16 15:08:59 +00:00
2022-06-21 22:54:17 +00:00
error[E0381]: partially assigned binding `a` isn't fully initialized
--> $DIR/borrowck-uninit-ref-chain.rs:31:5
2018-10-16 15:08:59 +00:00
|
LL | let mut a: S<&&i32, &&i32>;
2022-06-21 22:54:17 +00:00
| ----- binding declared here but left uninitialized
LL | a.x = &&0;
| ^^^^^^^^^ `a` partially assigned here but it isn't fully initialized
|
2022-06-21 22:54:17 +00:00
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
2018-10-16 15:08:59 +00:00
error: aborting due to 7 previous errors
2018-08-08 12:28:26 +00:00
For more information about this error, try `rustc --explain E0381`.