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

bigger-arrays feature doesn't work #4

Open
foltik opened this issue Mar 7, 2020 · 1 comment
Open

bigger-arrays feature doesn't work #4

foltik opened this issue Mar 7, 2020 · 1 comment

Comments

@foltik
Copy link

foltik commented Mar 7, 2020

Cargo.toml

glsl-layout = { version = "0.3.2", features = ["bigger-arrays"] }

main.rs

use glsl_layout::AsStd140;

#[derive(Copy, Clone, AsStd140)]
struct MyStd140 {
    array: [f32; 256]
}

Gives the errors:

error[E0277]: the trait bound `[_GLSL_LAYOUT_MyStd140::_glsl_layout::Element<f32>; 256]: std::default::Default` is not satisfied
 --> src/main.rs:3:23
  |
3 | #[derive(Copy, Clone, AsStd140)]
  |                       ^^^^^^^^ the trait `std::default::Default` is not implemented for `[_GLSL_LAYOUT_MyStd140::_glsl_layout::Element<f32>; 256]`
  |
  = help: the following implementations were found:
            <&[T] as std::default::Default>
            <&mut [T] as std::default::Default>
            <[T; 0] as std::default::Default>
            <[T; 10] as std::default::Default>
          and 31 others
  = note: required by `std::default::Default::default`

error[E0277]: arrays only have std trait implementations for lengths 0..=32
 --> src/main.rs:3:23
  |
3 | #[derive(Copy, Clone, AsStd140)]
  |                       ^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[_GLSL_LAYOUT_MyStd140::_glsl_layout::Element<f32>; 256]`
  |
  = note: required because of the requirements on the impl of `std::fmt::Debug` for `[_GLSL_LAYOUT_MyStd140::_glsl_layout::Element<f32>; 256]`
  = note: required because of the requirements on the impl of `std::fmt::Debug` for `&[_GLSL_LAYOUT_MyStd140::_glsl_layout::Element<f32>; 256]`
  = note: required for the cast to the object type `dyn std::fmt::Debug`
@zakarumych
Copy link
Collaborator

I guess the only option is to remove those bounds.

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

No branches or pull requests

2 participants