Skip to content

[docs] rust-toolchain file content #2473

@drmason13

Description

@drmason13

Problem
The section on rust-toolchain file doesn't say how to simply pick a channel using the file.

I found that simply the word nightly would work where the more verbose content:

[toolchain]
channel = "nightly"

did not work

Steps

  1. cargo new foo
  2. cd foo and create a file named rust-toolchain with the verbose content:
[toolchain]
channel = "nightly"
  1. rustup show

Possible Solution(s)
Update the documentation with an example of using a channel name with no TOML markup

Using a channel (stable, beta or nightly) in a repository can be achieved by setting the content of rust-toolchain to the name of the channel, without any additional TOML markup:
e.g. to use the latest nightly channel, rust-toolchain should only contain:

nightly

Notes

Output of rustup --version:

rustup 1.22.1 (b01adbbc3 2020-07-08)

Output of rustup show:

Default host: x86_64-pc-windows-msvc
rustup home:  C:\Users\masond\.rustup

(error: invalid channel name '[toolchain]' in '\\?\C:\Users\masond\code\rust\foo\rust-toolchain', invalid toolchain name: '[toolchain]')

Output of rustup update:

info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: checking for self-updates

   stable-x86_64-pc-windows-msvc unchanged - rustc 1.46.0 (04488afe3 2020-08-24)        
  nightly-x86_64-pc-windows-msvc unchanged - rustc 1.48.0-nightly (d006f5734 2020-08-28)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions