@@ -212,18 +212,35 @@ async fn list_toolchains_with_none() {
212
212
}
213
213
214
214
#[ tokio:: test]
215
- async fn remove_toolchain ( ) {
215
+ async fn remove_toolchain_default ( ) {
216
216
let mut cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
217
217
cx. config . expect_ok ( & [ "rustup" , "update" , "nightly" ] ) . await ;
218
- cx. config
219
- . expect_ok ( & [ "rustup" , "toolchain" , "remove" , "nightly" ] )
220
- . await ;
218
+ cx. config . expect_stderr_ok (
219
+ & [ "rustup" , "toolchain" , "remove" , "nightly" ] ,
220
+ "after removing the default toolchain, proc-macros and build scripts might no longer build" ,
221
+ ) . await ;
221
222
cx. config . expect_ok ( & [ "rustup" , "toolchain" , "list" ] ) . await ;
222
223
cx. config
223
224
. expect_stdout_ok ( & [ "rustup" , "toolchain" , "list" ] , "no installed toolchains" )
224
225
. await ;
225
226
}
226
227
228
+ #[ tokio:: test]
229
+ async fn remove_toolchain_active ( ) {
230
+ let mut cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
231
+ cx. config . expect_ok ( & [ "rustup" , "default" , "nightly" ] ) . await ;
232
+ cx. config
233
+ . expect_ok ( & [ "rustup" , "override" , "set" , "stable" ] )
234
+ . await ;
235
+ cx. config . expect_stderr_ok (
236
+ & [ "rustup" , "toolchain" , "remove" , "stable" ] ,
237
+ "after removing the active toolchain, proc-macros and build scripts might no longer build" ,
238
+ ) . await ;
239
+ cx. config
240
+ . expect_stdout_ok ( & [ "rustup" , "toolchain" , "list" ] , "nightly" )
241
+ . await ;
242
+ }
243
+
227
244
// Issue #2873
228
245
#[ tokio:: test]
229
246
async fn remove_toolchain_ignore_trailing_slash ( ) {
0 commit comments