Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Cannot build tcod-rs on OS X 10.11 - as_ref(), as_bytes() errors #205

@ysgard

Description

@ysgard

Putting in place the workaround described in my earlier 'SDL include' issue (#204) yields a different error:

➜  tcod-rs git:(master) cargo build
   Compiling tcod-sys v3.0.0 (file:///Users/ysgard/Dropbox/Rust/tcod-rs)
   Compiling tcod v0.8.0 (file:///Users/ysgard/Dropbox/Rust/tcod-rs)
src/console.rs:479:39: 479:62 error: mismatched types:
 expected `&std::path::Path`,
    found `&core::convert::AsRef<std::path::Path>`
(expected struct `std::path::Path`,
    found trait core::convert::AsRef) [E0308]
src/console.rs:479                 Root::set_custom_font(self.font_path.as_ref(),
                                                         ^~~~~~~~~~~~~~~~~~~~~~~
src/console.rs:479:39: 479:62 help: run `rustc --explain E0308` to see a detailed explanation
src/console.rs:486:60: 486:70 error: no method named `as_bytes` found for type `&core::convert::AsRef<str>` in the current scope
src/console.rs:486             let c_title = CString::new(self.title.as_ref().as_bytes()).unwrap();
                                                                              ^~~~~~~~~~
error: aborting due to 2 previous errors
Could not compile `tcod`.

To learn more, run the command again with --verbose.

This is being built against the Rust nightly line:

➜  tcod-rs git:(master) rustc -V
rustc 1.5.0-nightly (81b3b27cf 2015-10-11)

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