@@ -1540,9 +1540,6 @@ impl Config {
1540
1540
}
1541
1541
}
1542
1542
1543
- let file_content = t ! ( fs:: read_to_string( config. src. join( "src/ci/channel" ) ) ) ;
1544
- let ci_channel = file_content. trim_end ( ) ;
1545
-
1546
1543
// Give a hard error if `--config` or `RUST_BOOTSTRAP_CONFIG` are set to a missing path,
1547
1544
// but not if `bootstrap.toml` hasn't been created.
1548
1545
let mut toml = if !using_default_path || toml_path. exists ( ) {
@@ -1847,16 +1844,20 @@ impl Config {
1847
1844
let mut lld_enabled = None ;
1848
1845
let mut std_features = None ;
1849
1846
1847
+ let file_content = t ! ( fs:: read_to_string( config. src. join( "src/ci/channel" ) ) ) ;
1848
+ let ci_channel = file_content. trim_end ( ) ;
1849
+
1850
1850
let is_user_configured_rust_channel =
1851
- if let Some ( channel ) = toml. rust . as_ref ( ) . and_then ( |r| r. channel . clone ( ) ) {
1852
- if channel == "auto-detect" {
1851
+ match toml. rust . as_ref ( ) . and_then ( |r| r. channel . clone ( ) ) {
1852
+ Some ( channel ) if channel == "auto-detect" => {
1853
1853
config. channel = ci_channel. into ( ) ;
1854
- } else {
1854
+ true
1855
+ }
1856
+ Some ( channel) => {
1855
1857
config. channel = channel;
1858
+ true
1856
1859
}
1857
- true
1858
- } else {
1859
- false
1860
+ None => false ,
1860
1861
} ;
1861
1862
1862
1863
let default = config. channel == "dev" ;
@@ -1882,6 +1883,10 @@ impl Config {
1882
1883
&& config. src . join ( ".cargo/config.toml" ) . exists ( ) ,
1883
1884
) ;
1884
1885
1886
+ if !is_user_configured_rust_channel && config. rust_info . is_from_tarball ( ) {
1887
+ config. channel = ci_channel. into ( ) ;
1888
+ }
1889
+
1885
1890
if let Some ( rust) = toml. rust {
1886
1891
let Rust {
1887
1892
optimize : optimize_toml,
@@ -2085,8 +2090,6 @@ impl Config {
2085
2090
2086
2091
config. channel = channel;
2087
2092
}
2088
- } else if config. rust_info . is_from_tarball ( ) && !is_user_configured_rust_channel {
2089
- ci_channel. clone_into ( & mut config. channel ) ;
2090
2093
}
2091
2094
2092
2095
if let Some ( llvm) = toml. llvm {
0 commit comments