@@ -13,6 +13,7 @@ pub enum Profile {
1313 Compiler ,
1414 Codegen ,
1515 Library ,
16+ Tools ,
1617 User ,
1718}
1819
@@ -24,15 +25,16 @@ impl Profile {
2425 pub fn all ( ) -> impl Iterator < Item = Self > {
2526 use Profile :: * ;
2627 // N.B. these are ordered by how they are displayed, not alphabetically
27- [ Library , Compiler , Codegen , User ] . iter ( ) . copied ( )
28+ [ Library , Compiler , Codegen , Tools , User ] . iter ( ) . copied ( )
2829 }
2930
3031 pub fn purpose ( & self ) -> String {
3132 use Profile :: * ;
3233 match self {
3334 Library => "Contribute to the standard library" ,
34- Compiler => "Contribute to the compiler or rustdoc " ,
35+ Compiler => "Contribute to the compiler itself " ,
3536 Codegen => "Contribute to the compiler, and also modify LLVM or codegen" ,
37+ Tools => "Contribute to tools which depend on the compiler, but do not modify it directly (e.g. rustdoc, clippy, miri)" ,
3638 User => "Install Rust from source" ,
3739 }
3840 . to_string ( )
@@ -53,9 +55,12 @@ impl FromStr for Profile {
5355 fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
5456 match s {
5557 "lib" | "library" => Ok ( Profile :: Library ) ,
56- "compiler" | "rustdoc" => Ok ( Profile :: Compiler ) ,
58+ "compiler" => Ok ( Profile :: Compiler ) ,
5759 "llvm" | "codegen" => Ok ( Profile :: Codegen ) ,
5860 "maintainer" | "user" => Ok ( Profile :: User ) ,
61+ "tools" | "tool" | "rustdoc" | "clippy" | "miri" | "rustfmt" | "rls" => {
62+ Ok ( Profile :: Tools )
63+ }
5964 _ => Err ( format ! ( "unknown profile: '{}'" , s) ) ,
6065 }
6166 }
@@ -68,6 +73,7 @@ impl fmt::Display for Profile {
6873 Profile :: Codegen => write ! ( f, "codegen" ) ,
6974 Profile :: Library => write ! ( f, "library" ) ,
7075 Profile :: User => write ! ( f, "user" ) ,
76+ Profile :: Tools => write ! ( f, "tools" ) ,
7177 }
7278 }
7379}
@@ -103,6 +109,14 @@ pub fn setup(src_path: &Path, profile: Profile) {
103109
104110 let suggestions = match profile {
105111 Profile :: Codegen | Profile :: Compiler => & [ "check" , "build" , "test" ] [ ..] ,
112+ Profile :: Tools => & [
113+ "check" ,
114+ "build" ,
115+ "test src/test/rustdoc*" ,
116+ "test src/tools/clippy" ,
117+ "test src/tools/miri" ,
118+ "test src/tools/rustfmt" ,
119+ ] ,
106120 Profile :: Library => & [ "check" , "build" , "test library/std" , "doc" ] ,
107121 Profile :: User => & [ "dist" , "build" ] ,
108122 } ;
0 commit comments