8000 uwrite with alloc::string::String? no_std target · Issue #31 · japaric/ufmt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
uwrite with alloc::string::String? no_std target #31
Open
@dragonnn

Description

@dragonnn

Hi!
I am trying to craft a environment for my embedded board.
Trying to use ufmt uwrite! with alloc::string::String but getting such errors:

error[E0599]: the method `do_as_formatter` exists for struct `String`, but its trait bounds were not satisfied
   --> src/main.rs:24:9
    |
24  |         ufmt::uwrite!(s, "hello from rust: {}!\n", i);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `String` due to unsatisfied trait bounds
    | 
   ::: /home/mateusz/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/string.rs:278:1
    |
278 | pub struct String {
    | -----------------
    | |
    | doesn't satisfy `String: UnstableDoAsFormatter`
    | doesn't satisfy `String: uWrite`
    |
    = note: the following trait bounds were not satisfied:
            `String: uWrite`
            which is required by `String: UnstableDoAsFormatter`
            `str: uWrite`
            which is required by `str: UnstableDoAsFormatter`
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

I already have a working allocator since the underlying system is based on nuttx and I just use libc_alloc with uses malloc and other options from directly nuttx libc.
I would be really grateful for any help, I am stuck with that currently

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0