@@ -311,44 +311,28 @@ impl Builder {
311
311
}
312
312
313
313
fn add_profiles_to ( & mut self , manifest : & mut Manifest ) {
314
- let mut profile = |name, pkgs| self . profile ( name, & mut manifest. profiles , pkgs) ;
315
- profile ( "minimal" , & [ "rustc" , "cargo" , "rust-std" , "rust-mingw" ] ) ;
316
- profile (
317
- "default" ,
318
- & [
319
- "rustc" ,
320
- "cargo" ,
321
- "rust-std" ,
322
- "rust-mingw" ,
323
- "rust-docs" ,
324
- "rustfmt-preview" ,
325
- "clippy-preview" ,
326
- ] ,
327
- ) ;
328
- profile (
329
- "complete" ,
330
- & [
331
- "rustc" ,
332
- "cargo" ,
333
- "rust-std" ,
334
- "rust-mingw" ,
335
- "rust-docs" ,
336
- "rustfmt-preview" ,
337
- "clippy-preview" ,
338
- "rls-preview" ,
339
- "rust-analyzer-preview" ,
340
- "rust-src" ,
341
- "llvm-tools-preview" ,
342
- "rust-analysis" ,
343
- "miri-preview" ,
344
- ] ,
345
- ) ;
314
+ use PkgType :: * ;
315
+
316
+ let mut profile = |name, pkgs : & _ | self . profile ( name, & mut manifest. profiles , pkgs) ;
317
+
318
+ // Use a Vec here to make sure we don't exclude any components in an earlier profile.
319
+ let minimal = vec ! [ Rustc , Cargo , RustStd , RustMingw ] ;
320
+ profile ( "minimal" , & minimal) ;
321
+
322
+ let mut default = minimal;
323
+ default. extend ( [ HtmlDocs , Rustfmt , Clippy ] ) ;
324
+ profile ( "default" , & default) ;
325
+
326
+ // NOTE: this profile is effectively deprecated; do not add new components to it.
327
+ let mut complete = default;
328
+ complete. extend ( [ Rls , RustAnalyzer , RustSrc , LlvmTools , RustAnalysis , Miri ] ) ;
329
+ profile ( "complete" , & complete) ;
346
330
347
331
// The compiler libraries are not stable for end users, and they're also huge, so we only
348
332
// `rustc-dev` for nightly users, and only in the "complete" profile. It's still possible
349
333
// for users to install the additional component manually, if needed.
350
334
if self . versions . channel ( ) == "nightly" {
351
- self . extend_profile ( "complete" , & mut manifest. profiles , & [ "rustc-dev" ] ) ;
335
+ self . extend_profile ( "complete" , & mut manifest. profiles , & [ RustcDev ] ) ;
352
336
// Do not include the rustc-docs component for now, as it causes
353
337
// conflicts with the rust-docs component when installed. See
354
338
// #75833.
@@ -468,20 +452,23 @@ impl Builder {
468
452
& mut self ,
469
453
profile_name : & str ,
470
454
dst : & mut BTreeMap < String , Vec < String > > ,
471
- pkgs : & [ & str ] ,
455
+ pkgs : & [ PkgType ] ,
472
456
) {
473
- dst. insert ( profile_name. to_owned ( ) , pkgs. iter ( ) . map ( |s| ( * s) . to_owned ( ) ) . collect ( ) ) ;
457
+ dst. insert (
458
+ profile_name. to_owned ( ) ,
459
+ pkgs. iter ( ) . map ( |s| s. manifest_component_name ( ) ) . collect ( ) ,
460
+ ) ;
474
461
}
475
462
476
463
fn extend_profile (
477
464
& mut self ,
478
465
profile_name : & str ,
479
466
dst : & mut BTreeMap < String , Vec < String > > ,
480
- pkgs : & [ & str ] ,
467
+ pkgs : & [ PkgType ] ,
481
468
) {
482
469
dst. get_mut ( profile_name)
483
470
. expect ( "existing profile" )
484
- . extend ( pkgs. iter ( ) . map ( |s| ( * s ) . to_owned ( ) ) ) ;
471
+ . extend ( pkgs. iter ( ) . map ( |s| s . manifest_component_name ( ) ) ) ;
485
472
}
486
473
487
474
fn package (
0 commit comments