This error occurs when an attempt is made to partially reinitialize a structure that is currently uninitialized.
For example, this can happen when a drop has taken place:
#![allow(unused)]
fn main() {
struct Foo {
a: u32,
}
impl Drop for Foo {
fn drop(&mut self) { /* ... */ }
}
let mut x = Foo { a: 1 };
drop(x); // `x` is now uninitialized
x.a = 2; // error, partial reinitialization of uninitialized structure `t`
} This error can be fixed by fully reinitializing the structure in question:
#![allow(unused)]
fn main() {
struct Foo {
a: u32,
}
impl Drop for Foo {
fn drop(&mut self) { /* ... */ }
}
let mut x = Foo { a: 1 };
drop(x);
x = Foo { a: 2 };
}
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/error_codes/E0383.html