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

docs: cleanup warnings #922

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

docs: cleanup warnings #922

wants to merge 1 commit into from

Conversation

joshka
Copy link
Collaborator

@joshka joshka commented Aug 26, 2024

warning: unexpected `cfg` condition name: `winapi`
   --> src/lib.rs:256:11
    |
256 | #[cfg(all(winapi, not(feature = "winapi")))]
    |           ^^^^^^
    |
    = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
             unexpected_cfgs = { level = "warn", check-cfg = ['cfg(winapi)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(winapi)");` to the top of the `build.rs`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default

warning: unexpected `cfg` condition value: `winapi`
   --> src/lib.rs:256:23
    |
256 | #[cfg(all(winapi, not(feature = "winapi")))]
    |                       ^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bracketed-paste`, `default`, `event-stream`, `events`, `filedescriptor`, `libc`, `serde`, `use-dev-tty`, and `windows`
    = help: consider adding `winapi` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: unexpected `cfg` condition name: `crossterm_winapi`
   --> src/lib.rs:259:11
    |
259 | #[cfg(all(crossterm_winapi, not(feature = "crossterm_winapi")))]
    |           ^^^^^^^^^^^^^^^^
    |
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
             unexpected_cfgs = { level = "warn", check-cfg = ['cfg(crossterm_winapi)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(crossterm_winapi)");` to the top of the `build.rs`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: unexpected `cfg` condition value: `crossterm_winapi`
   --> src/lib.rs:259:33
    |
259 | #[cfg(all(crossterm_winapi, not(feature = "crossterm_winapi")))]
    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bracketed-paste`, `default`, `event-stream`, `events`, `filedescriptor`, `libc`, `serde`, `use-dev-tty`, and `windows`
    = help: consider adding `crossterm_winapi` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: `crate::event::read` is both a function and a module
  --> src/cursor/sys/unix.rs:16:32
   |
16 | /// [`crossterm::event::read`](crate::event::read) or [`crossterm::event::poll`](crate::event::poll) are being...
   |                                ^^^^^^^^^^^^^^^^^^ ambiguous link
   |
   = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
help: to link to the function, add parentheses
   |
16 | /// [`crossterm::event::read`](crate::event::read()) or [`crossterm::event::poll`](crate::event::poll) are being called.
   |                                                  ++
help: to link to the module, prefix with `mod@`
   |
16 | /// [`crossterm::event::read`](mod@crate::event::read) or [`crossterm::event::poll`](crate::event::poll) are being called.
   |                                ++++

warning: `crate::event::read` is both a function and a module
   --> src/terminal/sys/unix.rs:184:32
    |
184 | /// [`crossterm::event::read`](crate::event::read) or [`crossterm::event::poll`](crate::event::poll) are bein...
    |                                ^^^^^^^^^^^^^^^^^^ ambiguous link
    |
help: to link to the function, add parentheses
    |
184 | /// [`crossterm::event::read`](crate::event::read()) or [`crossterm::event::poll`](crate::event::poll) are being called.
    |                                                  ++
help: to link to the module, prefix with `mod@`
    |
184 | /// [`crossterm::event::read`](mod@crate::event::read) or [`crossterm::event::poll`](crate::event::poll) are being called.
    |                                ++++

warning: this URL is not a hyperlink
  --> src/style/types/colored.rs:74:31
   |
74 |     /// in environment as per https://no-color.org/
   |                               ^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://no-color.org/>`
   |
   = note: bare URLs are not automatically turned into clickable links
   = note: `#[warn(rustdoc::bare_urls)]` on by default

warning: this URL is not a hyperlink
   --> src/style.rs:187:34
    |
187 | /// crossterm supports NO_COLOR (https://no-color.org/) to disabled colored output.
    |                                  ^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://no-color.org/>`
    |
    = note: bare URLs are not automatically turned into clickable links

warning: this URL is not a hyperlink
   --> src/terminal.rs:151:15
    |
151 | /// For unix, https://man7.org/linux/man-pages/man4/tty_ioctl.4.html documents them as "unused".
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://man7.org/linux/man-pages/man4/tty_ioctl.4.html>`
    |
    = note: bare URLs are not automatically turned into clickable links

warning: `crossterm` (lib doc) generated 9 warnings (run `cargo fix --lib -p crossterm` to apply 3 suggestions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s
   Generated /Users/joshka/local/crossterm/target/doc/crossterm/index.html

@joshka joshka requested a review from TimonPost as a code owner August 26, 2024 20:06
Comment on lines -256 to -260
#[cfg(all(winapi, not(feature = "winapi")))]
compile_error!("Compiling on Windows with \"winapi\" feature disabled. Feature \"winapi\" should only be disabled when project will never be compiled on Windows.");

#[cfg(all(crossterm_winapi, not(feature = "crossterm_winapi")))]
compile_error!("Compiling on Windows with \"crossterm_winapi\" feature disabled. Feature \"crossterm_winapi\" should only be disabled when project will never be compiled on Windows.");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is no winap / crossterm_winapi cfg constant, there is also no explicit feature for either of these. Both dependencies are included when the windows feature is enabled, so these lines are not possible to trigger and would be redundant anyway.

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.

1 participant