Skip to content

Avoid cfg_if in std::os #81969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2021
Merged

Avoid cfg_if in std::os #81969

merged 1 commit into from
Feb 23, 2021

Conversation

jonas-schievink
Copy link
Contributor

@jonas-schievink jonas-schievink commented Feb 10, 2021

rust-analyzer cannot currently load the cfg_if crate, which means that rust-analyzer is unable to see std::os::{unix, windows, linux} here. This works around that by avoiding cfg_if; the #[cfg] expressions are simple enough to reasonably write by hand.

Fixes rust-lang/rust-analyzer#6038

@rust-highfive
Copy link
Contributor

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 10, 2021
@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member

jyn514 commented Feb 11, 2021

rust-analyzer cannot currently load the cfg_if crate

Is there an issue open for this?

@jonas-schievink
Copy link
Contributor Author

Well, apart from the issue linked above, no, but I'll create a new one. rust-lang/rust-analyzer#6038 (comment) explains in more detail what isn't working.

@jonas-schievink
Copy link
Contributor Author

Opened rust-lang/rust-analyzer#7637


}
}
#[cfg(any(doc, target_os = "linux", target_os = "l4re"))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to note that this is technically a behavior change -- previously doc and l4re didn't result in a linux module I think -- but that seems fine to me.

@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Feb 20, 2021

📌 Commit 4bf910b has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 20, 2021
@JohnTitor
Copy link
Member

Failed in rollup: #82355 (comment)
I guess we missed some targets.
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 21, 2021
@jyn514
Copy link
Member

jyn514 commented Feb 21, 2021

@bors rollup=iffy

@jonas-schievink
Copy link
Contributor Author

@bors r=Mark-Simulacrum

@bors
Copy link
Collaborator

bors commented Feb 22, 2021

📌 Commit 7bc5016 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 22, 2021
@bors bors merged commit c3de8ab into rust-lang:master Feb 23, 2021
@rustbot rustbot added this to the 1.52.0 milestone Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unresolved import for platform specific modules
8 participants