File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -103,9 +103,16 @@ fn rustc_minor_nightly() -> Option<(u32, bool)> {
103
103
}
104
104
105
105
let minor = pieces. next ( ) ;
106
- let nightly_raw = otry ! ( otry!( pieces. next( ) ) . split( '-' ) . nth( 1 ) ) ;
107
- let nightly =
108
- nightly_raw. starts_with ( "dev" ) || nightly_raw. starts_with ( "nightly" ) ;
106
+
107
+ // If `rustc` was built from a tarball, its version string
108
+ // will have neither a git hash nor a commit date
109
+ // (e.g. "rustc 1.39.0"). Treat this case as non-nightly,
110
+ // since a nightly build should either come from CI
111
+ // or a git checkout
112
+ let nightly_raw = otry ! ( pieces. next( ) ) . split ( '-' ) . nth ( 1 ) ;
113
+ let nightly = nightly_raw
114
+ . map ( |raw| raw. starts_with ( "dev" ) || raw. starts_with ( "nightly" ) )
115
+ . unwrap_or ( false ) ;
109
116
let minor = otry ! ( otry!( minor) . parse( ) . ok( ) ) ;
110
117
111
118
Some ( ( minor, nightly) )
You can’t perform that action at this time.
0 commit comments