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

Fix clippy lint mismatched_target_os #290

Merged
merged 1 commit into from May 16, 2024
Merged

Conversation

jschwe
Copy link
Contributor

@jschwe jschwe commented Apr 27, 2024

Fix the deny-by-default clippy lint mismatched_target_os. We rename the linux cfg option to free_unix, which more accurately represents how it is used. The naming follows the cfg names chosen by the winit crate.

The wayland cfg is slightly adjusted, to only be selected as the default if 1. wayland is enabled AND 2. either x11 is disabled, or the sm-wayland-default is selected

Example clippy error message:

error: operating system used in target family position
  --> surfman/src/platform/unix/mod.rs:13:1
   |
13 | #[cfg(linux)]
   | ^^^^^^-----^^
   |       |
   |       help: try: `target_os = "linux"`
   |
   = help: did you mean `unix`?
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mismatched_target_os

Fix the deny-by-default clippy lint `mismatched_target_os`.
We rename the `linux` cfg option to `free_unix`, which
more accurately represents how it is used. The naming follows the
cfg names chosen by the `winit` crate.
the `wayland` cfg is slightly adjusted, to only be selected as
the default if 1. wayland is enabled AND 2. either x11 is disabled,
or the `sm-wayland-default` is selected

Example clippy error message:
```
error: operating system used in target family position
  --> surfman/src/platform/unix/mod.rs:13:1
   |
13 | #[cfg(linux)]
   | ^^^^^^-----^^
   |       |
   |       help: try: `target_os = "linux"`
   |
   = help: did you mean `unix`?
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mismatched_target_os
 ```

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
@mrobinson mrobinson added this pull request to the merge queue May 16, 2024
Merged via the queue into servo:main with commit d848b1c May 16, 2024
16 checks passed
@jschwe jschwe deleted the jschwender/cfg branch May 16, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants