@@ -13,6 +13,7 @@ pub enum Profile {
13
13
Compiler ,
14
14
Codegen ,
15
15
Library ,
16
+ Tools ,
16
17
User ,
17
18
}
18
19
@@ -24,15 +25,16 @@ impl Profile {
24
25
pub fn all ( ) -> impl Iterator < Item = Self > {
25
26
use Profile :: * ;
26
27
// 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 ( )
28
29
}
29
30
30
31
pub fn purpose ( & self ) -> String {
31
32
use Profile :: * ;
32
33
match self {
33
34
Library => "Contribute to the standard library" ,
34
- Compiler => "Contribute to the compiler or rustdoc " ,
35
+ Compiler => "Contribute to the compiler itself " ,
35
36
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)" ,
36
38
User => "Install Rust from source" ,
37
39
}
38
40
. to_string ( )
@@ -53,9 +55,12 @@ impl FromStr for Profile {
53
55
fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
54
56
match s {
55
57
"lib" | "library" => Ok ( Profile :: Library ) ,
56
- "compiler" | "rustdoc" => Ok ( Profile :: Compiler ) ,
58
+ "compiler" => Ok ( Profile :: Compiler ) ,
57
59
"llvm" | "codegen" => Ok ( Profile :: Codegen ) ,
58
60
"maintainer" | "user" => Ok ( Profile :: User ) ,
61
+ "tools" | "tool" | "rustdoc" | "clippy" | "miri" | "rustfmt" | "rls" => {
62
+ Ok ( Profile :: Tools )
63
+ }
59
64
_ => Err ( format ! ( "unknown profile: '{}'" , s) ) ,
60
65
}
61
66
}
@@ -68,6 +73,7 @@ impl fmt::Display for Profile {
68
73
Profile :: Codegen => write ! ( f, "codegen" ) ,
69
74
Profile :: Library => write ! ( f, "library" ) ,
70
75
Profile :: User => write ! ( f, "user" ) ,
76
+ Profile :: Tools => write ! ( f, "tools" ) ,
71
77
}
72
78
}
73
79
}
@@ -103,6 +109,14 @@ pub fn setup(src_path: &Path, profile: Profile) {
103
109
104
110
let suggestions = match profile {
105
111
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
+ ] ,
106
120
Profile :: Library => & [ "check" , "build" , "test library/std" , "doc" ] ,
107
121
Profile :: User => & [ "dist" , "build" ] ,
108
122
} ;
0 commit comments