@@ -1544,9 +1544,6 @@ impl Config {
1544
1544
}
1545
1545
}
1546
1546
1547
- let file_content = t ! ( fs:: read_to_string( config. src. join( "src/ci/channel" ) ) ) ;
1548
- let ci_channel = file_content. trim_end ( ) ;
1549
-
1550
1547
// Give a hard error if `--config` or `RUST_BOOTSTRAP_CONFIG` are set to a missing path,
1551
1548
// but not if `bootstrap.toml` hasn't been created.
1552
1549
let mut toml = if !using_default_path || toml_path. exists ( ) {
@@ -1852,17 +1849,21 @@ impl Config {
1852
1849
let mut lld_enabled = None ;
1853
1850
let mut std_features = None ;
1854
1851
1855
- let is_user_configured_rust_channel =
1856
- if let Some ( channel ) = toml . rust . as_ref ( ) . and_then ( |r| r . channel . clone ( ) ) {
1857
- if channel == "auto-detect" {
1858
- config . channel = ci_channel . into ( ) ;
1859
- } else {
1860
- config . channel = channel ;
1861
- }
1852
+ let file_content = t ! ( fs :: read_to_string ( config . src . join ( "src/ci/channel" ) ) ) ;
1853
+ let ci_channel = file_content . trim_end ( ) ;
1854
+
1855
+ let toml_channel = toml . rust . as_ref ( ) . and_then ( |r| r . channel . clone ( ) ) ;
1856
+ let is_user_configured_rust_channel = match toml_channel {
1857
+ Some ( channel ) if channel == "auto-detect" => {
1858
+ config . channel = ci_channel . into ( ) ;
1862
1859
true
1863
- } else {
1864
- false
1865
- } ;
1860
+ }
1861
+ Some ( channel) => {
1862
+ config. channel = channel;
1863
+ true
1864
+ }
1865
+ None => false ,
1866
+ } ;
1866
1867
1867
1868
let default = config. channel == "dev" ;
1868
1869
config. omit_git_hash = toml. rust . as_ref ( ) . and_then ( |r| r. omit_git_hash ) . unwrap_or ( default) ;
@@ -1887,6 +1888,10 @@ impl Config {
1887
1888
&& config. src . join ( ".cargo/config.toml" ) . exists ( ) ,
1888
1889
) ;
1889
1890
1891
+ if !is_user_configured_rust_channel && config. rust_info . is_from_tarball ( ) {
1892
+ config. channel = ci_channel. into ( ) ;
1893
+ }
1894
+
1890
1895
if let Some ( rust) = toml. rust {
1891
1896
let Rust {
1892
1897
optimize : optimize_toml,
@@ -2090,8 +2095,6 @@ impl Config {
2090
2095
2091
2096
config. channel = channel;
2092
2097
}
2093
- } else if config. rust_info . is_from_tarball ( ) && !is_user_configured_rust_channel {
2094
- ci_channel. clone_into ( & mut config. channel ) ;
2095
2098
}
2096
2099
2097
2100
if let Some ( llvm) = toml. llvm {
0 commit comments