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

[ARM breakage] Same old same old #844

Closed
MagaTailor opened this issue Jan 5, 2016 · 8 comments · Fixed by #863
Closed

[ARM breakage] Same old same old #844

MagaTailor opened this issue Jan 5, 2016 · 8 comments · Fixed by #863

Comments

@MagaTailor
Copy link

More fallout from rust-lang/rust#29867

Compiling gfx_device_gl v0.7.0
  /home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/gfx_device_gl-0.7.0/src/shade.rs:314:21: 314:69 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/gfx_device_gl-0.7.0/src/shade.rs:314                     target.as_bytes_with_nul().as_ptr() as *const i8);
                                                                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/gfx_device_gl-0.7.0/src/shade.rs:314:21: 314:69 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/gfx_device_gl-0.7.0/src/shade.rs:328:46: 328:94 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/gfx_device_gl-0.7.0/src/shade.rs:328                 gl.GetFragDataLocation(name, target.as_bytes_with_nul().as_ptr() as *const i8)
                                                                                                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/gfx_device_gl-0.7.0/src/shade.rs:328:46: 328:94 help: run `rustc --explain E0308` to see a detailed explanation
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/gfx_device_gl-0.7.0/src/info.rs:145:55: 145:60 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/gfx_device_gl-0.7.0/src/info.rs:145     mem::transmute(str::from_utf8(ffi::CStr::from_ptr(c_str).to_bytes()).unwrap())
                                                                                                                                                       ^~~~~
/home/odroid/.cargo/registry/src/github.com-48ad6e4054423464/gfx_device_gl-0.7.0/src/info.rs:145:55: 145:60 help: run `rustc --explain E0308` to see a detailed explanation

Using nightly rust 1.7 on armv7 Linux.

@kvark
Copy link
Member

kvark commented Jan 5, 2016

Thanks for the report!

@MagaTailor
Copy link
Author

Hi,

A quick and sufficient fix is to cast every instance to *const _ whereas if you wanted to get rid of the problem altogether here's the latest solution.

@kvark
Copy link
Member

kvark commented Jan 8, 2016

@petevine thanks! please consider filing a PR

@MagaTailor
Copy link
Author

No prob! You're probably aware of the issue which led to the travis failure. On my local 1.7 from before that change all compiles cleanly.

@andresv
Copy link

andresv commented Feb 7, 2016

It fails also with rust-1.6-stable on RPi2:

   Compiling gfx_device_gl v0.7.0
/home/pi/.multirust/toolchains/1.6/cargo/registry/src/github.com-48ad6e4054423464/gfx_device_gl-0.7.0/src/shade.rs:314:21: 314:69 error: mismatched types:
 expected `*const u8`,
    found `*const i8`
(expected u8,
    found i8) [E0308]

@MagaTailor
Copy link
Author

I didn't follow the situation after the PR that'd fixed this issue got reverted.

@andresv Do you mean there's just one error now or you simply pasted a snippet?

@andresv
Copy link

andresv commented Feb 8, 2016

I just pasted the first error.

@MagaTailor
Copy link
Author

Nope, the patch was made partly redundant in 0.8.0.

I'm going to fix one remaining error and it's good to go.

@kvark kvark closed this as completed in #863 Feb 8, 2016
adamnemecek pushed a commit to adamnemecek/gfx that referenced this issue Apr 1, 2021
844: Add mip level count and array layer count validation to texture_create_view r=kvark a=kunalmohan

**Connections**
_Link to the issues addressed by this PR, or dependent PRs in other repositories_

**Description**
_Describe what problem this is solving, and how it's solved._
Catches the error when `mip_level_count = 0` and `base_mip_level > texture.mip_level_count` (same with `array_layer_count`)

**Testing**
_Explain how this change is tested._
Haven't been tested yet
<!--
Non-trivial functional changes would need to be tested through:
  - [wgpu-rs](https://github.com/gfx-rs/wgpu-rs) - test the examples.
  - [wgpu-native](https://github.com/gfx-rs/wgpu-native/) - check the generated C header for sanity.

Ideally, a PR needs to link to the draft PRs in these projects with relevant modifications.
See gfx-rs/wgpu#666 for an example.
If you can add a unit/integration test here in `wgpu`, that would be best.
-->


Co-authored-by: Kunal Mohan <kunalmohan99@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants