3 ms·
> T only contains owned types I'd say this is true, because I consider &mut T and &T to be owned types in their own right. They own a pointer. I can cast them
by est31 6y ago
> T only contains owned types
I'd say this is true, because I consider &mut T and &T to be owned types in their own right. They own a pointer. I can cast them to raw pointers. &T impl's Copy even if T doesn't. https://doc.rust-lang.org/1.43.1/src/core/marker.rs.html#794 https://doc.rust-lang.org/1.43.1/src/core/marker.rs.html#794
Otherwise, the compilation is great.
- whyever 6y agoThis is not how the author uses the word owned.
- est31 6y agoIf you use the author's definition of the owned term as "some non-reference type, e.g. i32, String, Vec, etc", the misconception is indeed one. But I disagree with the definition.
- justinpombrio 6y agoIs there any type that is _not_ owned by this definition?
- Rusky 6y agoNot really- which is why "owned type" is kind of imprecise and usually just means "a type not constrained by any lifetime."