3 ms·
It won't compile, because the compiler keeps track of where you moved the value and notices that x now has no value. If you want the function to borrow the argu
by db48x 7y ago
It won't compile, because the compiler keeps track of where you moved the value and notices that x now has no value. If you want the function to borrow the argument instead, make it take a reference, &x.