File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -254,10 +254,18 @@ impl Sysroot {
254254 . ok ( ) ?;
255255 let current_dir =
256256 AbsPathBuf :: try_from ( & * format ! ( "{sysroot_src_dir}/sysroot" ) ) . ok ( ) ?;
257+
258+ let mut cargo_config = CargoConfig :: default ( ) ;
259+ // the sysroot uses `public-dependency`, so we make cargo think it's a nightly
260+ cargo_config. extra_env . insert (
261+ "__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS" . to_owned ( ) ,
262+ "nightly" . to_owned ( ) ,
263+ ) ;
264+
257265 let res = CargoWorkspace :: fetch_metadata (
258266 & sysroot_cargo_toml,
259267 & current_dir,
260- & CargoConfig :: default ( ) ,
268+ & cargo_config ,
261269 None ,
262270 & |_| ( ) ,
263271 )
Original file line number Diff line number Diff line change @@ -117,8 +117,6 @@ impl Metrics {
117117 sh,
118118 "./target/release/rust-analyzer -q analysis-stats {path} --query-sysroot-metadata"
119119 )
120- // the sysroot uses `public-dependency`, so we make cargo think it's a nightly
121- . env ( "__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS" , "nightly" )
122120 . read ( ) ?;
123121 for ( metric, value, unit) in parse_metrics ( & output) {
124122 self . report ( & format ! ( "analysis-stats/{name}/{metric}" ) , value, unit. into ( ) ) ;
You can’t perform that action at this time.
0 commit comments