mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
Set channel override when querying the sysroot metadata
This commit is contained in:
parent
a02a219773
commit
c738655188
2 changed files with 9 additions and 3 deletions
|
@ -254,10 +254,18 @@ impl Sysroot {
|
|||
.ok()?;
|
||||
let current_dir =
|
||||
AbsPathBuf::try_from(&*format!("{sysroot_src_dir}/sysroot")).ok()?;
|
||||
|
||||
let mut cargo_config = CargoConfig::default();
|
||||
// the sysroot uses `public-dependency`, so we make cargo think it's a nightly
|
||||
cargo_config.extra_env.insert(
|
||||
"__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS".to_owned(),
|
||||
"nightly".to_owned(),
|
||||
);
|
||||
|
||||
let res = CargoWorkspace::fetch_metadata(
|
||||
&sysroot_cargo_toml,
|
||||
¤t_dir,
|
||||
&CargoConfig::default(),
|
||||
&cargo_config,
|
||||
None,
|
||||
&|_| (),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue