Skip to content

[BUG] wiki-tui fails to compile using cargo #265

@jasper-zanjani

Description

@jasper-zanjani

General Information
Version: latest
Installation Method: cargo (1.87.0)
Operating System: Fedora 42

Used configuration (if available):

cargo 1.87.0
rustc 1.87.0

Describe the bug
Cargo fails to compile wiki-tui

To Reproduce
Steps to reproduce the behavior:

  1. Run cargo install wiki-tui
# --snip--
   Compiling wiki-tui v0.9.1
error[E0308]: mismatched types
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/components/logger.rs:41:20
    |
41  |             .block(self.theme.default_block().title("Log"))
    |              ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::widgets::block::Block<'_>`, found `ratatui::widgets::Block<'_>`
    |              |
    |              arguments to this method are incorrect
    |
note: two different versions of crate `ratatui` are being used; two types coming from two different versions of the same crate are different types even if they look the same
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.26.3/src/widgets/block.rs:64:1
    |
64  | pub struct Block<'a> {
    | ^^^^^^^^^^^^^^^^^^^^ this is the found type `ratatui::widgets::Block`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.27.0/src/widgets/block.rs:67:1
    |
67  | pub struct Block<'a> {
    | ^^^^^^^^^^^^^^^^^^^^ this is the expected type `ratatui::widgets::block::Block`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/components/logger.rs:9:5
    |
9   | use tui_logger::{TuiLoggerWidget, TuiWidgetState};
    |     ---------- one version of crate `ratatui` used here, as a dependency of crate `tui_logger`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/app.rs:5:5
    |
5   | use ratatui::{
    |     ------- one version of crate `ratatui` used here, as a direct dependency of the current crate
    = help: you can use `cargo tree` to explore your dependency tree
note: method defined here
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tui-logger-0.11.2/src/lib.rs:923:12
    |
923 |     pub fn block(mut self, block: Block<'b>) -> Self {
    |            ^^^^^

error[E0308]: mismatched types
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/components/logger.rs:42:26
    |
42  |             .style_error(Style::default().fg(Color::Red))
    |              ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found a different `ratatui::style::Style`
    |              |
    |              arguments to this method are incorrect
    |
note: two different versions of crate `ratatui` are being used; two types coming from two different versions of the same crate are different types even if they look the same
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.26.3/src/style.rs:227:1
    |
227 | pub struct Style {
    | ^^^^^^^^^^^^^^^^ this is the found type `ratatui::style::Style`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.27.0/src/style.rs:228:1
    |
228 | pub struct Style {
    | ^^^^^^^^^^^^^^^^ this is the expected type `ratatui::style::Style`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/components/logger.rs:9:5
    |
9   | use tui_logger::{TuiLoggerWidget, TuiWidgetState};
    |     ---------- one version of crate `ratatui` used here, as a dependency of crate `tui_logger`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/app.rs:5:5
    |
5   | use ratatui::{
    |     ------- one version of crate `ratatui` used here, as a direct dependency of the current crate
    = help: you can use `cargo tree` to explore your dependency tree
note: method defined here
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tui-logger-0.11.2/src/lib.rs:967:12
    |
967 |     pub fn style_error(mut self, style: Style) -> Self {
    |            ^^^^^^^^^^^

error[E0308]: mismatched types
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/components/logger.rs:43:25
    |
43  |             .style_warn(Style::default().fg(Color::Yellow))
    |              ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found a different `ratatui::style::Style`
    |              |
    |              arguments to this method are incorrect
    |
note: two different versions of crate `ratatui` are being used; two types coming from two different versions of the same crate are different types even if they look the same
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.26.3/src/style.rs:227:1
    |
227 | pub struct Style {
    | ^^^^^^^^^^^^^^^^ this is the found type `ratatui::style::Style`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.27.0/src/style.rs:228:1
    |
228 | pub struct Style {
    | ^^^^^^^^^^^^^^^^ this is the expected type `ratatui::style::Style`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/components/logger.rs:9:5
    |
9   | use tui_logger::{TuiLoggerWidget, TuiWidgetState};
    |     ---------- one version of crate `ratatui` used here, as a dependency of crate `tui_logger`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/app.rs:5:5
    |
5   | use ratatui::{
    |     ------- one version of crate `ratatui` used here, as a direct dependency of the current crate
    = help: you can use `cargo tree` to explore your dependency tree
note: method defined here
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tui-logger-0.11.2/src/lib.rs:971:12
    |
971 |     pub fn style_warn(mut self, style: Style) -> Self {
    |            ^^^^^^^^^^

error[E0308]: mismatched types
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/components/logger.rs:44:25
    |
44  |             .style_info(Style::default().fg(Color::Cyan))
    |              ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found a different `ratatui::style::Style`
    |              |
    |              arguments to this method are incorrect
    |
note: two different versions of crate `ratatui` are being used; two types coming from two different versions of the same crate are different types even if they look the same
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.26.3/src/style.rs:227:1
    |
227 | pub struct Style {
    | ^^^^^^^^^^^^^^^^ this is the found type `ratatui::style::Style`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.27.0/src/style.rs:228:1
    |
228 | pub struct Style {
    | ^^^^^^^^^^^^^^^^ this is the expected type `ratatui::style::Style`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/components/logger.rs:9:5
    |
9   | use tui_logger::{TuiLoggerWidget, TuiWidgetState};
    |     ---------- one version of crate `ratatui` used here, as a dependency of crate `tui_logger`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/app.rs:5:5
    |
5   | use ratatui::{
    |     ------- one version of crate `ratatui` used here, as a direct dependency of the current crate
    = help: you can use `cargo tree` to explore your dependency tree
note: method defined here
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tui-logger-0.11.2/src/lib.rs:975:12
    |
975 |     pub fn style_info(mut self, style: Style) -> Self {
    |            ^^^^^^^^^^

error[E0308]: mismatched types
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/components/logger.rs:45:26
    |
45  |             .style_debug(Style::default().fg(Color::Green))
    |              ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found a different `ratatui::style::Style`
    |              |
    |              arguments to this method are incorrect
    |
note: two different versions of crate `ratatui` are being used; two types coming from two different versions of the same crate are different types even if they look the same
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.26.3/src/style.rs:227:1
    |
227 | pub struct Style {
    | ^^^^^^^^^^^^^^^^ this is the found type `ratatui::style::Style`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.27.0/src/style.rs:228:1
    |
228 | pub struct Style {
    | ^^^^^^^^^^^^^^^^ this is the expected type `ratatui::style::Style`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/components/logger.rs:9:5
    |
9   | use tui_logger::{TuiLoggerWidget, TuiWidgetState};
    |     ---------- one version of crate `ratatui` used here, as a dependency of crate `tui_logger`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/app.rs:5:5
    |
5   | use ratatui::{
    |     ------- one version of crate `ratatui` used here, as a direct dependency of the current crate
    = help: you can use `cargo tree` to explore your dependency tree
note: method defined here
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tui-logger-0.11.2/src/lib.rs:983:12
    |
983 |     pub fn style_debug(mut self, style: Style) -> Self {
    |            ^^^^^^^^^^^

error[E0308]: mismatched types
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/components/logger.rs:46:26
    |
46  |             .style_trace(Style::default().fg(Color::Magenta))
    |              ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found a different `ratatui::style::Style`
    |              |
    |              arguments to this method are incorrect
    |
note: two different versions of crate `ratatui` are being used; two types coming from two different versions of the same crate are different types even if they look the same
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.26.3/src/style.rs:227:1
    |
227 | pub struct Style {
    | ^^^^^^^^^^^^^^^^ this is the found type `ratatui::style::Style`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.27.0/src/style.rs:228:1
    |
228 | pub struct Style {
    | ^^^^^^^^^^^^^^^^ this is the expected type `ratatui::style::Style`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/components/logger.rs:9:5
    |
9   | use tui_logger::{TuiLoggerWidget, TuiWidgetState};
    |     ---------- one version of crate `ratatui` used here, as a dependency of crate `tui_logger`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/app.rs:5:5
    |
5   | use ratatui::{
    |     ------- one version of crate `ratatui` used here, as a direct dependency of the current crate
    = help: you can use `cargo tree` to explore your dependency tree
note: method defined here
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tui-logger-0.11.2/src/lib.rs:979:12
    |
979 |     pub fn style_trace(mut self, style: Style) -> Self {
    |            ^^^^^^^^^^^

error[E0277]: the trait bound `TuiLoggerWidget<'_>: Widget` is not satisfied
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/components/logger.rs:48:29
    |
48  |         frame.render_widget(widget, size)
    |               ------------- ^^^^^^ the trait `Widget` is not implemented for `TuiLoggerWidget<'_>`
    |               |
    |               required by a bound introduced by this call
    |
note: there are multiple different versions of crate `ratatui` in the dependency graph
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.26.3/src/widgets.rs:100:1
    |
100 | pub trait Widget {
    | ^^^^^^^^^^^^^^^^ this is the required trait
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/app.rs:5:5
    |
5   | use ratatui::{
    |     ------- one version of crate `ratatui` used here, as a direct dependency of the current crate
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wiki-tui-0.9.1/src/components/logger.rs:9:5
    |
9   | use tui_logger::{TuiLoggerWidget, TuiWidgetState};
    |     ---------- one version of crate `ratatui` used here, as a dependency of crate `tui_logger`
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tui-logger-0.11.2/src/lib.rs:883:1
    |
883 | pub struct TuiLoggerWidget<'b> {
    | ------------------------------ this type doesn't implement the required trait
    |
   ::: /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.27.0/src/backend.rs:163:1
    |
163 | pub trait Backend {
    | ----------------- this is the found trait
    = help: you can use `cargo tree` to explore your dependency tree
note: required by a bound in `ratatui::Frame::<'_>::render_widget`
   --> /home/jasper/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.26.3/src/terminal/frame.rs:74:29
    |
74  |     pub fn render_widget<W: Widget>(&mut self, widget: W, area: Rect) {
    |                             ^^^^^^ required by this bound in `Frame::<'_>::render_widget`

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `wiki-tui` (lib) due to 7 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `wiki-tui v0.9.1`, intermediate artifacts can be found at `/tmp/cargo-installd9RBmA`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugThis fixes a bug. Increment the minor version

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions