-
Notifications
You must be signed in to change notification settings - Fork 45
Cannot build tcod-rs on OS X 10.11 - as_ref(), as_bytes() errors #205
Comments
Yep, saw this as well, it seems to be a breaking change in the nightly. I can't send a PR right away, but it can be solved by adding an explicit deref to the lines mentioned, example: (*self.font_path).as_ref()
(*self.title).as_ref().as_bytes() |
That fixes it for me as well. I'm still learning Rust - is this an accidental breakage, or a new direction the Rust team is leaning towards? |
I've no idea unfortunately, I had no time to keep up with changes in recent nightlies. It would be interesting to see, since they shouldn't introduce breaking changes before 2.0, and this change to deref semantics seems a bit unnecessary. EDIT: thanks to Reddit, found the PR in question: rust-lang/rust#28811. |
Also @tomassedovic, these errors are both related to title: Box<AsRef<str> + 'a>
font_path: Box<AsRef<Path> + 'a> Don't you think that if we're doing a heap allocation anyway (for the |
Yeah, good point on just using the heap-allocated values anyway. And I'm not too happy about this breaking change either. They're using crater, but tcod-rs and tcod-sys don't compile because of the missing SDL dependencies. So the Rust devs don't see any regressions from us. I'd love us to compile cleanly there but I'm not sure how to go about doing that. |
I feel like that is more of a crater deficiency than a As much as I don't like it, we could add the SDL sources (a'la |
@brson, are you aware of this sort of hole in crater's coverage? Is there anything we can do to accommodate this? |
Yes, sadly only native deps that I've loaded into the crater docker image work. |
@brson is there a way to detect we're compiling under crater? This seems to boil down to the build script failing. But we only care about the Rust code in crater so if we could skip the native stuff, our code would be checked as well. |
Yes. If you look at one of the existing crater runs there are several env @brson https://github.com/brson is there a way to detect we're compiling — |
Thanks. I see So we'll check for them in the build script and won't compile the non-rust dependencies in that case. |
Putting in place the workaround described in my earlier 'SDL include' issue (#204) yields a different error:
This is being built against the Rust nightly line:
The text was updated successfully, but these errors were encountered: