Toolchain version on new package was different from default every time I created project.

Problem

Same as title.

Solution

  • Run rustup show
Default host: x86_64-pc-windows-msvc
rustup home:  *my rustup home*
installed toolchains
--------------------
stable-x86_64-pc-windows-msvc (default)
1.42.0-x86_64-pc-windows-msvc

active toolchain
----------------

1.42.0-x86_64-pc-windows-msvc (overridden by *'A path to toolchain file.'*)
rustc 1.42.0 (b8cedc004 2020-03-09)
  • Delete the overriding toolchain file at *'A path to toolchain file.'*.

Comment

Toolchain file overrides toolchain version below the file directory. If you don't need the override, you can delete the file.

日本語

cargo init(あるいはnew)をしたときにtoolchainのバージョンがdefaultにならないという問題に直面した。
どうやら知らない間にtoolchainのバージョンを指定するファイルが作られていたためにすべてオーバーライドされていた。そのためtoolchainファイルを削除することで解決した。
原因として知らぬ間にcargo competeを誤ってrootディレクトリで行ったからだと考えている。100%自分の失態。