Skip to content

Conversation

@Wilfred
Copy link
Contributor

@Wilfred Wilfred commented Oct 23, 2024

Some types in core are conditionally compiled based on target_has_atomic or target_has_atomic_load_store without an argument, for example AtomicU64.

This is less noticeable in Cargo projects, where rust-analyzer adds the output of RUSTC_BOOTSTRAP=1 cargo rustc --print cfg so it gets the full set of cfg flags.

This fixes go-to-definition on std::sync::atomic::AtomicU64 in non-cargo projects.

Some types in `core` are conditionally compiled based on
`target_has_atomic` or `target_has_atomic_load_store` without an
argument, for example `AtomicU64`.

This is less noticeable in Cargo projects, where rust-analyzer adds
the output `RUSTC_BOOTSTRAP=1 cargo rustc --print cfg` so it gets the
full set of cfg flags.

This fixes go-to-definition on `std::sync::atomic::AtomicU64` in
non-cargo projects.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 23, 2024
@Wilfred Wilfred marked this pull request as ready for review October 23, 2024 23:48
@Veykril
Copy link
Member

Veykril commented Oct 24, 2024

This is less noticeable in Cargo projects, where rust-analyzer adds the output of RUSTC_BOOTSTRAP=1 cargo rustc --print cfg so it gets the full set of cfg flags.

Sounds like we should make that work for non cargo projects as well (and ideally remove the hardcoded stuff here entirely)

@Veykril Veykril added this pull request to the merge queue Oct 24, 2024
Merged via the queue into rust-lang:master with commit 6342667 Oct 24, 2024
9 checks passed
@Wilfred Wilfred deleted the missing_cfg_for_core branch October 24, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants