The mut specifier on function parameters doesn't mean that you pass a value by reference and mutate it. Rust never does it. All arguments are always passed by move. The mut specifier just means that you can mutate the corresponding local variable within the function. Without an explicit mut, local variables are always immutable (sans types with interior mutability).
Your function declaration is equivalent to the following:
Which makes it obvious why the caller's value wasn't mutated.
If you want to mutate an external value, you need to pass it explicitly as a &mut, and correspondingly create a &mut ptr at the call site, as @jbe shows in the example.