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

explicit str, rustc 1.34.0 doesn't seem to pick this up otherwise #3191

Merged
merged 1 commit into from Jan 15, 2020
Merged

explicit str, rustc 1.34.0 doesn't seem to pick this up otherwise #3191

merged 1 commit into from Jan 15, 2020

Conversation

ghost
Copy link

@ghost ghost commented Jan 15, 2020

Potential fix for issue reference: #3190

As outlined by user in the issue I was unable to build new TUI logger code in older versions of rust (ie. 1.34.0), rustc does not seem to be able to properly convert the entry.log String variable referenced.

   Compiling grin v3.1.0-beta.1 (/home/cadwgan/grin_dev/grin)
error[E0277]: the trait bound `std::string::String: std::convert::From<&std::string::String>` is not satisfied
  --> src/bin/tui/logs.rs:92:23
   |
92 |                 let log_message = StyledString::plain(&entry.log as &String);
   |                                   ^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<&std::string::String>` is not implemented for `std::string::String`
   |
   = help: the following implementations were found:
             <std::string::String as std::convert::From<&'a str>>
             <std::string::String as std::convert::From<std::borrow::Cow<'a, str>>>
             <std::string::String as std::convert::From<std::boxed::Box<str>>>
   = note: required because of the requirements on the impl of `std::convert::Into<std::string::String>` for `&std::string::String`
   = note: required by `cursive::utils::markup::<impl cursive::utils::span::SpannedString<cursive::theme::style::Style>>::plain`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: Could not compile `grin`.

After casting with as_str(), I built the code in both 1.34.0 and 1.37.0. Tried node out on floonet and the log panel is outputting node logs.

Compiling grin v3.1.0-beta.1 (/home/cadwgan/grin_dev/grin)
    Finished dev [unoptimized + debuginfo] target(s) in 9.27s

Copy link
Member

@antiochp antiochp left a comment

Choose a reason for hiding this comment

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

👍

@antiochp antiochp merged commit 8568c77 into mimblewimble:master Jan 15, 2020
@antiochp antiochp mentioned this pull request Feb 24, 2020
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

1 participant