Skip to content

Comment on Formally Verifying Rust's Opaque Typesparent

Comments

Can't the function just return `(a.clone, a.clone())`?

Maybe you mean something like this? `fn extend_vec(to: &mut Vec<i32>, from: &Vec<i32>) { ... }`

This does not compile if you pass the same Vec as to and from, because of the `&mut`

Without a trait bound that demands cloneable items, no.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.