Closed as not planned
Description
I tried this code:
pub fn example(vec: Vec<u32>) -> Vec<u32> {
Some(vec).unwrap()
}
I expected to see this happen: a simple move
Instead, this happened: extra logic was added to check for None
see https://godbolt.org/z/sozWosj88
this does not happen with u32
and &Vec<u32>
: https://godbolt.org/z/crhePq97z
Meta
godbolt's rustc version:
rustc 1.71.0-nightly (dbba59457 2023-05-01)