Version issue in Rust (because of brew)

When trying to run cargo run in my first Rust program, I just encountered this problem:

error: failed to parse lock file at:
Caused by:
invalid serialized PackageId for key `package.dependencies`

As it turns out the reason was that rust was installed two times:

1. With brew, such that rustc --version = 1.3.7

2. With the usual rust installation way, so that I also had version 1.5 (according to rustup)

Of course, the brew-rust was being called the whole time. So the simple solution was: brew uninstall rust, so that the other (newer) version remains.