> Would it be more accurate to say that Rust guarantees the droppability of owned values?
I'm not really sure, exactly, since "droppability" isn't really a thing that's talked about, because as you're sort of getting at here, it's universal, and therefore not really an interesting concept.
> I know there's a guarantee that &'static items never have their underlying value dropped,
Even this is sort of... not correct. Consider this program:
#[derive(Debug)]
struct Boom;
impl Drop for Boom {
fn drop(&mut self) {
println!("BOOM");
}
}
use std::mem;
static mut FOO: Boom = Boom;
fn main() {
let mut s = Boom;
unsafe {
dbg!(&FOO);
mem::swap(&mut FOO, &mut s);
dbg!(&FOO);
}
}
This will print BOOM, as the initial Boom is swapped out from behind the reference and then dropped.