A question about ownership

I suspect it is me.

Edit: I did not manage to quote the topic directly; here is a link.

    let t = Test { id : "foo".to_owned(), val : 42 };
    let mut h : HashMap <&str, Test> = HashMap::new();
    // h.insert(t.id.clone(), t); // works
    let id = t.id.as_str() as *const str;
    unsafe {
        h.insert(&*id, t);
    }

It did work, but I decided to try doing it the Rust way first to see how it goes.