@@ -86,40 +86,88 @@ Let's start with something simple: installing multiple Rust toolchains. In this
86
86
example I create a new library, 'hello', then test it using rustc 1.8, then use
87
87
rustup to install and test that same crate on the 1.9 beta.
88
88
89
- <div style =" height :420px ;margin :20px ;" >
90
- <script type="text/javascript"
91
- src="https://asciinema.org/a/37cr19qny7451wenmpb113s1r.js"
92
- id="asciicast-37cr19qny7451wenmpb113s1r"
93
- async
94
- data-speed="2"
95
- ></script >
96
- </div >
97
-
98
- <!--
99
- ```
89
+ ``` console
100
90
$ cargo new hello && cd hello
101
91
$ rustc --version
92
+ rustc 1.8.0 (db2939409 2016-04-11)
102
93
$ cargo test
94
+ Compiling hello v0.1.0 (file:///home/user/hello)
95
+ Running target/debug/hello-b4f774924ded32e4
96
+
97
+ running 1 test
98
+ test tests::it_works ... ok
99
+
100
+ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
101
+
102
+ Doc-tests hello
103
+
104
+ running 0 tests
105
+
106
+ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
103
107
$ rustup install beta
108
+ info: syncing channel updates for 'beta-x86_64-unknown-linux-gnu'
109
+ info: latest update on 2016-04-11, rust version 1.9.0-beta (e4e8b6668 2016-04-11)
110
+ info: downloading component 'cargo'
111
+ info: downloading component 'rust-docs'
112
+ info: downloading component 'rust-std'
113
+ info: downloading component 'rustc'
114
+ info: installing component 'cargo'
115
+ info: installing component 'rust-docs'
116
+ info: installing component 'rust-std'
117
+ info: installing component 'rustc'
118
+
119
+ beta-x86_64-unknown-linux-gnu installed - rustc 1.9.0-beta (e4e8b6668 2016-04-11)
120
+
104
121
$ rustup run beta rustc --version
122
+ rustc 1.9.0-beta (e4e8b6668 2016-04-11)
105
123
$ rustup run beta cargo test
124
+ Compiling hello v0.1.0 (file:///home/user/hello)
125
+ Running target/debug/hello-f4f25bc615ec63f5
126
+
127
+ running 1 test
128
+ test tests::it_works ... ok
129
+
130
+ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
131
+
132
+ Doc-tests hello
133
+
134
+ running 0 tests
135
+
136
+ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
106
137
```
107
- -->
108
138
109
139
That's an easy way to verify your code works on the next Rust release. That's
110
140
good Rust citizenship!
111
141
112
142
We can use ` rustup show ` to show us the installed toolchains, and `rustup
113
143
update` to keep them up to date with Rust's releases.
114
144
115
- <div style =" height :420px ;margin :20px ;" >
116
- <script type="text/javascript"
117
- src="https://asciinema.org/a/ek7vdmfltncmgnip8cnuc6ua4.js"
118
- id="asciicast-ek7vdmfltncmgnip8cnuc6ua4"
119
- async
120
- data-speed="2"
121
- ></script >
122
- </div >
145
+ ``` console
146
+ $ rustup show
147
+ Default host: x86_64-unknown-linux-gnu
148
+ rustup home: /home/user/.rustup
149
+
150
+ installed toolchains
151
+ --------------------
152
+
153
+ stable-x86_64-unknown-linux-gnu (default)
154
+ beta-x86_64-unknown-linux-gnu
155
+
156
+ active toolchain
157
+ ----------------
158
+
159
+ stable-x86_64-unknown-linux-gnu (default)
160
+ rustc 1.8.0 (db2939409 2016-04-11)
161
+
162
+ $ rustup update
163
+ info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
164
+ info: syncing channel updates for 'beta-x86_64-unknown-linux-gnu'
165
+
166
+ stable-x86_64-unknown-linux-gnu unchanged - rustc 1.8.0 (db2939409 2016-04-11)
167
+ beta-x86_64-unknown-linux-gnu unchanged - rustc 1.9.0-beta (e4e8b6668 2016-04-11)
168
+
169
+ info: cleaning up downloads & tmp directories
170
+ ```
123
171
124
172
Finally, rustup can also change the default toolchain with ` rustup default ` :
125
173
0 commit comments