Skip to content
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

Avoid cfg_if in std::os #81969

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
Collaborator

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
Contributor

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 added a commit to JohnTitor/rust that referenced this pull request Feb 21, 2021
…imulacrum

Avoid `cfg_if` in `std::os`

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
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Feb 21, 2021
…imulacrum

Avoid `cfg_if` in `std::os`

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
@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
Contributor

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
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 23, 2021
…imulacrum

Avoid `cfg_if` in `std::os`

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
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 23, 2021
Rollup of 12 pull requests

Successful merges:

 - rust-lang#79423 (Enable smart punctuation)
 - rust-lang#81154 (Improve design of `assert_len`)
 - rust-lang#81235 (Improve suggestion for tuple struct pattern matching errors.)
 - rust-lang#81769 (Suggest `return`ing tail expressions that match return type)
 - rust-lang#81837 (Slight perf improvement on char::to_ascii_lowercase)
 - rust-lang#81969 (Avoid `cfg_if` in `std::os`)
 - rust-lang#81984 (Make WASI's `hard_link` behavior match other platforms.)
 - rust-lang#82091 (use PlaceRef abstractions more consistently)
 - rust-lang#82128 (add diagnostic items for OsString/PathBuf/Owned as well as to_vec on slice)
 - rust-lang#82166 (add s390x-unknown-linux-musl target)
 - rust-lang#82234 (Remove query parameters when skipping search results)
 - rust-lang#82255 (Make `treat_err_as_bug` Option<NonZeroUsize>)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@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
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 25, 2021
Move all `sys::ext` modules to `os`

This PR moves all `sys::ext` modules to `os`, centralizing the location of all `os` code and simplifying the dependencies between `os` and `sys`.

Because this also removes all uses `cfg_if!` on publicly exported items, where after rust-lang#81969 there were still a few left, this should properly work around rust-lang/rust-analyzer#6038.

`@rustbot` label: +T-libs-impl
bors added a commit to rust-lang-ci/rust that referenced this pull request May 5, 2021
Move all `sys::ext` modules to `os`

This PR moves all `sys::ext` modules to `os`, centralizing the location of all `os` code and simplifying the dependencies between `os` and `sys`.

Because this also removes all uses `cfg_if!` on publicly exported items, where after rust-lang#81969 there were still a few left, this should properly work around rust-lang/rust-analyzer#6038.

`@rustbot` label: +T-libs-impl
flip1995 pushed a commit to flip1995/rust that referenced this pull request May 6, 2021
Move all `sys::ext` modules to `os`

This PR moves all `sys::ext` modules to `os`, centralizing the location of all `os` code and simplifying the dependencies between `os` and `sys`.

Because this also removes all uses `cfg_if!` on publicly exported items, where after rust-lang#81969 there were still a few left, this should properly work around rust-lang/rust-analyzer#6038.

`@rustbot` label: +T-libs-impl
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