macroquad icon indicating copy to clipboard operation
macroquad copied to clipboard

macroquad-particles = "0.2" Will not compile

Open TheDanielPBerry opened this issue 2 years ago • 2 comments

Compiling macroquad-particles v0.2.0 error[E0574]: expected struct, variant or union type, found enum 'ShaderSource' --> /home/daniel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/macroquad-particles-0.2.0/src/lib.rs:568:17 | 568 | ShaderSource { | ^^^^^^^^^^^^ not a struct, variant or union type

error[E0574]: expected struct, variant or union type, found enum 'ShaderSource' --> /home/daniel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/macroquad-particles-0.2.0/src/lib.rs:610:17 | 610 | ShaderSource { | ^^^^^^^^^^^^ not a struct, variant or union type

error[E0061]: this method takes 3 arguments but 2 arguments were supplied --> /home/daniel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/macroquad-particles-0.2.0/src/lib.rs:642:17 | 642 | ctx.texture_set_filter(color_img, FilterMode::Nearest); | ^^^^^^^^^^^^^^^^^^-------------------------------- an argument of type 'MipmapFilterMode' is missing | note: method defined here --> /home/daniel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/miniquad-0.4.0-alpha.10/src/graphics.rs:1125:8 | 1125 | fn texture_set_filter( | ^^^^^^^^^^^^^^^^^^ help: provide the argument | 642 | ctx.texture_set_filter(color_img, FilterMode::Nearest, /* MipmapFilterMode */); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Some errors have detailed explanations: E0061, E0574. For more information about an error, try 'rustc --explain E0061'. error: could not compile 'macroquad-particles' (lib) due to 3 previous errors

TheDanielPBerry avatar Dec 26 '23 02:12 TheDanielPBerry

https://github.com/not-fl3/macroquad/commit/d17bee1b8bd8f056be171bcc897a6f45c97ec423#diff-c71544a874a6019b9949df6e660e8b78dd5c90a400242ec1170e441533a4e591 this might be the code of the fix, but apparently it did not made it to crates.io

Will fix soon!

not-fl3 avatar Dec 26 '23 05:12 not-fl3

Seeing the same problem a month later.

Workaround:

Put this in Cargo.toml

[dependencies]
macroquad = "0.4"
macroquad-particles = { git = "https://github.com/not-fl3/macroquad" }

This is enough for the rust to pickup correct dependency from subdirectory (see confirmation on cargo here )

Any ETA on fix of crates.io version? :)

Shelim avatar Jan 27 '24 21:01 Shelim

Current error after cargo add macroquad macroquad-particles

Error
error[E0659]: `RenderPass` is ambiguous
   --> /home/tux/.cargo/registry/src/index.crates.io-6f17d22bba15001f/macroquad-particles-0.2.1/src/lib.rs:506:27
    |
506 |     post_processing_pass: RenderPass,
    |                           ^^^^^^^^^^ ambiguous name
    |
    = note: ambiguous because of multiple glob imports of a name in the same module
note: `RenderPass` could refer to the struct imported here
   --> /home/tux/.cargo/registry/src/index.crates.io-6f17d22bba15001f/macroquad-particles-0.2.1/src/lib.rs:1:5
    |
1   | use macroquad::prelude::*;
    |     ^^^^^^^^^^^^^^^^^^^^^
    = help: consider adding an explicit import of `RenderPass` to disambiguate
note: `RenderPass` could also refer to the struct imported here
   --> /home/tux/.cargo/registry/src/index.crates.io-6f17d22bba15001f/macroquad-particles-0.2.1/src/lib.rs:2:5
    |
2   | use macroquad::window::miniquad::*;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: consider adding an explicit import of `RenderPass` to disambiguate

error[E0308]: mismatched types
   --> /home/tux/.cargo/registry/src/index.crates.io-6f17d22bba15001f/macroquad-particles-0.2.1/src/lib.rs:680:13
    |
680 |             post_processing_pass,
    |             ^^^^^^^^^^^^^^^^^^^^ expected `macroquad::texture::RenderPass`, found `macroquad::miniquad::RenderPass`
    |
    = note: `macroquad::miniquad::RenderPass` and `macroquad::texture::RenderPass` have similar names, but are actually distinct types
note: `macroquad::miniquad::RenderPass` is defined in crate `miniquad`
   --> /home/tux/.cargo/registry/src/index.crates.io-6f17d22bba15001f/miniquad-0.4.5/src/graphics.rs:556:1
    |
556 | pub struct RenderPass(usize);
    | ^^^^^^^^^^^^^^^^^^^^^
note: `macroquad::texture::RenderPass` is defined in crate `macroquad`
   --> /home/tux/.cargo/registry/src/index.crates.io-6f17d22bba15001f/macroquad-0.4.11/src/texture.rs:347:1
    |
347 | pub struct RenderPass {
    | ^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
   --> /home/tux/.cargo/registry/src/index.crates.io-6f17d22bba15001f/macroquad-particles-0.2.1/src/lib.rs:944:22
    |
944 |                 Some(self.post_processing_pass),
    |                 ---- ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `macroquad::miniquad::RenderPass`, found `macroquad::texture::RenderPass`
    |                 |
    |                 arguments to this enum variant are incorrect
    |
    = note: `macroquad::texture::RenderPass` and `macroquad::miniquad::RenderPass` have similar names, but are actually distinct types
note: `macroquad::texture::RenderPass` is defined in crate `macroquad`
   --> /home/tux/.cargo/registry/src/index.crates.io-6f17d22bba15001f/macroquad-0.4.11/src/texture.rs:347:1
    |
347 | pub struct RenderPass {
    | ^^^^^^^^^^^^^^^^^^^^^
note: `macroquad::miniquad::RenderPass` is defined in crate `miniquad`
   --> /home/tux/.cargo/registry/src/index.crates.io-6f17d22bba15001f/miniquad-0.4.5/src/graphics.rs:556:1
    |
556 | pub struct RenderPass(usize);
    | ^^^^^^^^^^^^^^^^^^^^^
help: the type constructed contains `macroquad::texture::RenderPass` due to the type of the argument passed
   --> /home/tux/.cargo/registry/src/index.crates.io-6f17d22bba15001f/macroquad-particles-0.2.1/src/lib.rs:944:17
    |
944 |                 Some(self.post_processing_pass),
    |                 ^^^^^-------------------------^
    |                      |
    |                      this argument influences the type of `Some`
note: tuple variant defined here
   --> /home/tux/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:579:5
    |
579 |     Some(#[stable(feature = "rust1", since = "1.0.0")] T),
    |     ^^^^

Some errors have detailed explanations: E0308, E0659.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `macroquad-particles` (lib) due to 3 previous errors

aceArt-GmbH avatar Jul 12 '24 14:07 aceArt-GmbH

This is already fixed in the latest commit to macroquad-particles (52cac9b), but the new version wasn't released on crates.io yet.

cyrgani avatar Jul 15 '24 09:07 cyrgani