Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Rust 1.6 breaks crate #22

Closed
MagaTailor opened this issue Dec 12, 2015 · 4 comments
Closed

Rust 1.6 breaks crate #22

MagaTailor opened this issue Dec 12, 2015 · 4 comments

Comments

@MagaTailor
Copy link

This issue has led to compilation errors:

Compiling sdl2_ttf v0.10.0
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:245:41: 245:57 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:245             let raw = ffi::TTF_OpenFont(cstring.as_ptr(), ptsize as c_int);
                                                                                                                                             ^~~~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:245:41: 245:57 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:258:46: 258:62 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:258             let raw = ffi::TTF_OpenFontIndex(cstring.as_ptr(), ptsize as c_int, index as c_long);
                                                                                                                                                  ^~~~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:258:46: 258:62 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:380:61: 380:66 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:380                 Some(String::from_utf8_lossy(CStr::from_ptr(cname).to_bytes()).to_string())
                                                                                                                                                                 ^~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:380:61: 380:66 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:392:61: 392:66 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:392                 Some(String::from_utf8_lossy(CStr::from_ptr(cname).to_bytes()).to_string())
                                                                                                                                                                 ^~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:392:61: 392:66 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:444:41: 444:55 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:444             ffi::TTF_SizeText(self.raw, ctext.as_ptr(), &w, &h)
                                                                                                                                             ^~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:444:41: 444:55 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:465:65: 465:80 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:465                             ffi::TTF_RenderText_Solid(self.raw, source.as_ptr(),
                                                                                                                                                                     ^~~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:465:65: 465:80 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:469:66: 469:81 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:469                             ffi::TTF_RenderText_Shaded(self.raw, source.as_ptr(),
                                                                                                                                                                      ^~~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:469:66: 469:81 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:473:67: 473:82 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:473                             ffi::TTF_RenderText_Blended(self.raw, source.as_ptr(),
                                                                                                                                                                       ^~~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:473:67: 473:82 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:477:75: 477:90 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:477                             ffi::TTF_RenderText_Blended_Wrapped(self.raw, source.as_ptr(),
                                                                                                                                                                               ^~~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:477:75: 477:90 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:487:65: 487:80 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:487                             ffi::TTF_RenderUTF8_Solid(self.raw, source.as_ptr(),
                                                                                                                                                                     ^~~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:487:65: 487:80 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:491:66: 491:81 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:491                             ffi::TTF_RenderUTF8_Shaded(self.raw, source.as_ptr(),
                                                                                                                                                                      ^~~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:491:66: 491:81 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:495:67: 495:82 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:495                             ffi::TTF_RenderUTF8_Blended(self.raw, source.as_ptr(),
                                                                                                                                                                       ^~~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:495:67: 495:82 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:499:75: 499:90 error: mismatched types:
 expected `*const i8`,
    found `*const u8`
(expected i8,
    found u8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:499                             ffi::TTF_RenderUTF8_Blended_Wrapped(self.raw, source.as_ptr(),
                                                                                                                                                                               ^~~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/sdl2_ttf-0.10.0/src/sdl2_ttf/lib.rs:499:75: 499:90 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to 13 previous errors
Could not compile `sdl2_image`.

A mechanical cast as *const _ seems to be enough of a fix in most cases.
Rust 1.5 is still fine.

MagaTailor referenced this issue in xsleonard/rust-sdl2_image Jan 5, 2016
Fix variable type issue with Rust 1.6
@MagaTailor
Copy link
Author

So, what's the plan for this crate? You should either accept the corrected PR or state if a switch to std::os::raw is coming (where applicable).

@andelf
Copy link
Owner

andelf commented Jan 14, 2016

I'll check this out tonight. sorry for the delay

@MagaTailor
Copy link
Author

Have a look at Smithay/wayland-rs#42 ; it should be much better to not depend on libc.

@MagaTailor
Copy link
Author

Fixed in master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants