Yesterday I talked about an issue I had updating a Rust project. The time between when that project was working for me and when it was not was only a few months.
But I have one other Rust project I haven't touched in a while. This little game.
In it, you play as a Pong paddle catching or dodging bullets from an alien. It was a fun project at the time and a good exercise with Rust.
It also does not compile today.
Compiling winit v0.19.5
error[E0308]: mismatched types
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.19.5/src/platform/macos/view.rs:209:9
|
205 | extern fn has_marked_text(this: &Object, _sel: Sel) -> BOOL {
| ---- expected `bool` because of return type
...
209 | (marked_text.length() > 0) as i8
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `i8`
error[E0308]: mismatched types
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.19.5/src/platform/macos/window.rs:103:26
|
103 | is_zoomed != 0
| --------- ^ expected `bool`, found integer
| |
| expected because this is `bool`
error[E0308]: mismatched types
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.19.5/src/platform/macos/window.rs:175:57
|
175 | self.window.setFrame_display_(new_rect, 0);
| ----------------- ^ expected `bool`, found integer
| |
| arguments to this method are incorrect
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cocoa-0.18.5/src/appkit.rs:932:15
|
932 | unsafe fn setFrame_display_(self, windowFrame: NSRect, display: BOOL);
| ^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.19.5/src/platform/macos/window.rs:1301:48
|
1301 | window.setFrame_display_(current_rect, 0)
| ----------------- ^ expected `bool`, found integer
| |
| arguments to this method are incorrect
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cocoa-0.18.5/src/appkit.rs:932:15
|
932 | unsafe fn setFrame_display_(self, windowFrame: NSRect, display: BOOL);
| ^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.19.5/src/platform/macos/window.rs:1308:48
|
1308 | window.setFrame_display_(current_rect, 0)
| ----------------- ^ expected `bool`, found integer
| |
| arguments to this method are incorrect
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cocoa-0.18.5/src/appkit.rs:932:15
|
932 | unsafe fn setFrame_display_(self, windowFrame: NSRect, display: BOOL);
| ^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.19.5/src/platform/macos/window.rs:1325:48
|
1325 | window.setFrame_display_(current_rect, 0)
| ----------------- ^ expected `bool`, found integer
| |
| arguments to this method are incorrect
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cocoa-0.18.5/src/appkit.rs:932:15
|
932 | unsafe fn setFrame_display_(self, windowFrame: NSRect, display: BOOL);
| ^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.19.5/src/platform/macos/window.rs:1332:48
|
1332 | window.setFrame_display_(current_rect, 0)
| ----------------- ^ expected `bool`, found integer
| |
| arguments to this method are incorrect
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cocoa-0.18.5/src/appkit.rs:932:15
|
932 | unsafe fn setFrame_display_(self, windowFrame: NSRect, display: BOOL);
| ^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0308`.
error: could not compile `winit` (lib) due to 7 previous errors
A lot of people suggested locking to an older version of the Rust toolchain. So I tried to set my laptop to have whatever the Rust compiler was the last time I made a commit on that project.
➜ alien_game git:(master) ✗ rustup toolchain install stable-2020-03-25
info: syncing channel updates for 'stable-2020-03-25-aarch64-apple-darwin'
error: no release found for 'stable-2020-03-25'
Oh, yeah. ARM Macs weren't a thing in 2020.
I no longer have the laptop I used to write this code.
I can't find a list of available toolchains online and trying every date is tiresome - maybe I'll script it if all else fails - but there are only two dependencies.
[dependencies]
ggez = "0.5"
rand = "0.7.3"
What if I just lock newer versions of winit
and cocoa
?
[dependencies]
ggez = "0.5"
rand = "0.7.3"
winit = "0.30.4"
cocoa = "0.25.0"
Compiling winit v0.19.5
error[E0308]: mismatched types
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.19.5/src/platform/macos/view.rs:209:9
|
205 | extern fn has_marked_text(this: &Object, _sel: Sel) -> BOOL {
| ---- expected `bool` because of return type
...
209 | (marked_text.length() > 0) as i8
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `i8`
error[E0308]: mismatched types
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.19.5/src/platform/macos/window.rs:103:26
|
103 | is_zoomed != 0
| --------- ^ expected `bool`, found integer
| |
| expected because this is `bool`
error[E0308]: mismatched types
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.19.5/src/platform/macos/window.rs:175:57
|
175 | self.window.setFrame_display_(new_rect, 0);
| ----------------- ^ expected `bool`, found integer
| |
| arguments to this method are incorrect
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cocoa-0.18.5/src/appkit.rs:932:15
|
932 | unsafe fn setFrame_display_(self, windowFrame: NSRect, display: BOOL);
| ^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.19.5/src/platform/macos/window.rs:1301:48
|
1301 | window.setFrame_display_(current_rect, 0)
| ----------------- ^ expected `bool`, found integer
| |
| arguments to this method are incorrect
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cocoa-0.18.5/src/appkit.rs:932:15
|
932 | unsafe fn setFrame_display_(self, windowFrame: NSRect, display: BOOL);
| ^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.19.5/src/platform/macos/window.rs:1308:48
|
1308 | window.setFrame_display_(current_rect, 0)
| ----------------- ^ expected `bool`, found integer
| |
| arguments to this method are incorrect
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cocoa-0.18.5/src/appkit.rs:932:15
|
932 | unsafe fn setFrame_display_(self, windowFrame: NSRect, display: BOOL);
| ^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.19.5/src/platform/macos/window.rs:1325:48
|
1325 | window.setFrame_display_(current_rect, 0)
| ----------------- ^ expected `bool`, found integer
| |
| arguments to this method are incorrect
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cocoa-0.18.5/src/appkit.rs:932:15
|
932 | unsafe fn setFrame_display_(self, windowFrame: NSRect, display: BOOL);
| ^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.19.5/src/platform/macos/window.rs:1332:48
|
1332 | window.setFrame_display_(current_rect, 0)
| ----------------- ^ expected `bool`, found integer
| |
| arguments to this method are incorrect
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cocoa-0.18.5/src/appkit.rs:932:15
|
932 | unsafe fn setFrame_display_(self, windowFrame: NSRect, display: BOOL);
| ^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0308`.
error: could not compile `winit` (lib) due to 7 previous errors
I guess hell or high water it is bringing in that version of winit
.
Well, what if I upgraded ggez
to the latest?
[dependencies]
ggez = "0.9.3"
rand = "0.7.3"
Compiling rustisbetter v0.1.0 (/Users/emccue/Development/alien_game)
error[E0432]: unresolved import `ggez::event::quit`
--> src/main.rs:2:25
|
2 | use ggez::event::{self, quit, EventHandler, KeyCode, KeyMods};
| ^^^^ no `quit` in `event`
error[E0432]: unresolved import `ggez::graphics::Font`
--> src/main.rs:4:5
|
4 | use ggez::graphics::Font;
| ^^^^^^^^^^^^^^^^^^^^ no `Font` in `graphics`
error[E0432]: unresolved import `ggez::nalgebra`
--> src/main.rs:6:11
|
6 | use ggez::nalgebra::Point2;
| ^^^^^^^^ could not find `nalgebra` in `ggez`
error[E0432]: unresolved import `ggez::nalgebra`
--> src/alien.rs:3:11
|
3 | use ggez::nalgebra::Point2;
| ^^^^^^^^ could not find `nalgebra` in `ggez`
error[E0432]: unresolved import `ggez::nalgebra`
--> src/bullet.rs:3:11
|
3 | use ggez::nalgebra::Point2;
| ^^^^^^^^ could not find `nalgebra` in `ggez`
error[E0425]: cannot find function `screen_coordinates` in module `graphics`
--> src/main.rs:177:44
|
177 | let screen_coordinates = graphics::screen_coordinates(&ctx);
| ^^^^^^^^^^^^^^^^^^ not found in `graphics`
error[E0425]: cannot find function `clear` in module `graphics`
--> src/main.rs:318:19
|
318 | graphics::clear(ctx, graphics::WHITE);
| ^^^^^ not found in `graphics`
error[E0425]: cannot find value `WHITE` in module `graphics`
--> src/main.rs:318:40
|
318 | graphics::clear(ctx, graphics::WHITE);
| ^^^^^ not found in `graphics`
error[E0425]: cannot find function `present` in module `graphics`
--> src/main.rs:324:19
|
324 | graphics::present(ctx)?;
| ^^^^^^^ not found in `graphics`
error[E0603]: enum `KeyCode` is private
--> src/main.rs:2:45
|
2 | use ggez::event::{self, quit, EventHandler, KeyCode, KeyMods};
| ^^^^^^^ private enum
|
note: the enum `KeyCode` is defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/event.rs:34:30
|
34 | use crate::input::keyboard::{KeyCode, KeyInput, KeyMods};
| ^^^^^^^
help: import `KeyCode` directly
|
2 | use ggez::event::{self, quit, EventHandler, winit::event::VirtualKeyCode, KeyMods};
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0603]: struct `KeyMods` is private
--> src/main.rs:2:54
|
2 | use ggez::event::{self, quit, EventHandler, KeyCode, KeyMods};
| ^^^^^^^ private struct
|
note: the struct `KeyMods` is defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/event.rs:34:49
|
34 | use crate::input::keyboard::{KeyCode, KeyInput, KeyMods};
| ^^^^^^^
help: import `KeyMods` directly
|
2 | use ggez::event::{self, quit, EventHandler, KeyCode, ggez::input::keyboard::KeyMods};
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: unused imports: `BlendMode`, `Rect`
--> src/main.rs:5:22
|
5 | use ggez::graphics::{BlendMode, DrawParam, Drawable, Rect, Text};
| ^^^^^^^^^ ^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `GameError`
--> src/main.rs:7:19
|
7 | use ggez::{audio, GameError};
| ^^^^^^^^^
warning: unused import: `rand::seq::SliceRandom`
--> src/main.rs:9:5
|
9 | use rand::seq::SliceRandom;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `std::error::Error`
--> src/main.rs:12:5
|
12 | use std::error::Error;
| ^^^^^^^^^^^^^^^^^
warning: unused import: `std::iter::Peekable`
--> src/main.rs:16:5
|
16 | use std::iter::Peekable;
| ^^^^^^^^^^^^^^^^^^^
warning: unused import: `std::iter::Peekable`
--> src/alien.rs:9:5
|
9 | use std::iter::Peekable;
| ^^^^^^^^^^^^^^^^^^^
warning: unused import: `std::ops::Add`
--> src/alien.rs:10:5
|
10 | use std::ops::Add;
| ^^^^^^^^^^^^^
warning: unnecessary parentheses around pattern
--> src/alien.rs:80:13
|
80 | let ((min_x, max_x)) = self.x_movement_range;
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
80 - let ((min_x, max_x)) = self.x_movement_range;
80 + let (min_x, max_x) = self.x_movement_range;
|
warning: use of deprecated function `ggez::filesystem::open`: Use `ctx.fs.open` instead
--> src/main.rs:142:65
|
142 | let data = audio::SoundData::from_read(&mut filesystem::open(ctx, "/Bloop.mp3")?)?;
| ^^^^
|
= note: `#[warn(deprecated)]` on by default
error[E0050]: method `key_down_event` has 5 parameters but the declaration in trait `key_down_event` has 4
--> src/main.rs:329:9
|
329 | / &mut self,
330 | | ctx: &mut Context,
331 | | keycode: KeyCode,
332 | | _keymods: KeyMods,
333 | | _repeat: bool,
| |_____________________^ expected 4 parameters, found 5
|
= note: `key_down_event` from trait: `fn(&mut Self, &mut ggez::Context, KeyInput, bool) -> Result<(), E>`
error[E0050]: method `key_up_event` has 4 parameters but the declaration in trait `key_up_event` has 3
--> src/main.rs:348:21
|
348 | fn key_up_event(&mut self, _ctx: &mut Context, keycode: KeyCode, _keymods: KeyMods) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 parameters, found 4
|
= note: `key_up_event` from trait: `fn(&mut Self, &mut ggez::Context, KeyInput) -> Result<(), E>`
error[E0053]: method `resize_event` has an incompatible type for trait
--> src/main.rs:358:76
|
358 | fn resize_event(&mut self, _ctx: &mut Context, width: f32, height: f32) {
| ^ expected `Result<(), GameError>`, found `()`
|
= note: expected signature `fn(&mut Game, &mut ggez::Context, _, _) -> Result<(), GameError>`
found signature `fn(&mut Game, &mut ggez::Context, _, _)`
help: change the output type to match the trait
|
358 | fn resize_event(&mut self, _ctx: &mut Context, width: f32, height: f32) -> Result<(), GameError> {
| ++++++++++++++++++++++++
error[E0308]: mismatched types
--> src/alien.rs:141:13
|
140 | sprite.draw(
| ---- arguments to this method are incorrect
141 | ctx,
| ^^^ expected `&mut Canvas`, found `&mut Context`
|
= note: expected mutable reference `&mut Canvas`
found mutable reference `&mut ggez::Context`
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/draw.rs:293:8
|
293 | fn draw(&self, canvas: &mut Canvas, param: impl Into<DrawParam>);
| ^^^^
error[E0308]: mismatched types
--> src/alien.rs:140:9
|
134 | pub fn draw(&self, ctx: &mut Context) -> GameResult<()> {
| -------------- expected `Result<(), GameError>` because of return type
...
140 | / sprite.draw(
141 | | ctx,
142 | | DrawParam::default()
143 | | .offset(Point2::new(0.5, 0.5))
144 | | .dest(Point2::new(self.pos.0, self.pos.1)),
145 | | )
| |_________^ expected `Result<(), GameError>`, found `()`
|
= note: expected enum `Result<(), GameError>`
found unit type `()`
help: try adding an expression at the end of the block
|
145 ~ );
146 + Ok(())
|
error[E0308]: mismatched types
--> src/bullet.rs:54:13
|
53 | self.sprite.draw(
| ---- arguments to this method are incorrect
54 | ctx,
| ^^^ expected `&mut Canvas`, found `&mut Context`
|
= note: expected mutable reference `&mut Canvas`
found mutable reference `&mut ggez::Context`
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/draw.rs:293:8
|
293 | fn draw(&self, canvas: &mut Canvas, param: impl Into<DrawParam>);
| ^^^^
error[E0308]: mismatched types
--> src/bullet.rs:53:9
|
52 | pub fn draw(&self, ctx: &mut Context) -> GameResult<()> {
| -------------- expected `Result<(), GameError>` because of return type
53 | / self.sprite.draw(
54 | | ctx,
55 | | DrawParam::default()
56 | | .offset(Point2::new(0.5, 0.5))
57 | | .dest(Point2::new(self.pos.0, self.pos.1))
58 | | .rotation(FRAC_PI_2),
59 | | )
| |_________^ expected `Result<(), GameError>`, found `()`
|
= note: expected enum `Result<(), GameError>`
found unit type `()`
help: try adding an expression at the end of the block
|
59 ~ );
60 + Ok(())
|
error[E0061]: this method takes 1 argument but 0 arguments were supplied
--> src/bullet.rs:100:34
|
100 | self.pos.0 - self.sprite.dimensions().w as f32 / 2.0
| ^^^^^^^^^^-- an argument of type `&_` is missing
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/draw.rs:299:8
|
299 | fn dimensions(&self, gfx: &impl Has<GraphicsContext>) -> Option<Rect>;
| ^^^^^^^^^^
help: provide the argument
|
100 | self.pos.0 - self.sprite.dimensions(/* gfx */).w as f32 / 2.0
| ~~~~~~~~~~~
error[E0609]: no field `w` on type `Option<Rect>`
--> src/bullet.rs:100:47
|
100 | self.pos.0 - self.sprite.dimensions().w as f32 / 2.0
| ^ unknown field
|
help: one of the expressions' fields has a field of the same name
|
100 | self.pos.0 - self.sprite.dimensions().unwrap().w as f32 / 2.0
| +++++++++
error[E0061]: this method takes 1 argument but 0 arguments were supplied
--> src/bullet.rs:104:34
|
104 | self.pos.1 - self.sprite.dimensions().h as f32 / 2.0
| ^^^^^^^^^^-- an argument of type `&_` is missing
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/draw.rs:299:8
|
299 | fn dimensions(&self, gfx: &impl Has<GraphicsContext>) -> Option<Rect>;
| ^^^^^^^^^^
help: provide the argument
|
104 | self.pos.1 - self.sprite.dimensions(/* gfx */).h as f32 / 2.0
| ~~~~~~~~~~~
error[E0609]: no field `h` on type `Option<Rect>`
--> src/bullet.rs:104:47
|
104 | self.pos.1 - self.sprite.dimensions().h as f32 / 2.0
| ^ unknown field
|
help: one of the expressions' fields has a field of the same name
|
104 | self.pos.1 - self.sprite.dimensions().unwrap().h as f32 / 2.0
| +++++++++
error[E0061]: this method takes 1 argument but 0 arguments were supplied
--> src/bullet.rs:108:21
|
108 | self.sprite.dimensions().w
| ^^^^^^^^^^-- an argument of type `&_` is missing
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/draw.rs:299:8
|
299 | fn dimensions(&self, gfx: &impl Has<GraphicsContext>) -> Option<Rect>;
| ^^^^^^^^^^
help: provide the argument
|
108 | self.sprite.dimensions(/* gfx */).w
| ~~~~~~~~~~~
error[E0609]: no field `w` on type `Option<Rect>`
--> src/bullet.rs:108:34
|
108 | self.sprite.dimensions().w
| ^ unknown field
|
help: one of the expressions' fields has a field of the same name
|
108 | self.sprite.dimensions().unwrap().w
| +++++++++
error[E0061]: this method takes 1 argument but 0 arguments were supplied
--> src/bullet.rs:112:21
|
112 | self.sprite.dimensions().h
| ^^^^^^^^^^-- an argument of type `&_` is missing
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/draw.rs:299:8
|
299 | fn dimensions(&self, gfx: &impl Has<GraphicsContext>) -> Option<Rect>;
| ^^^^^^^^^^
help: provide the argument
|
112 | self.sprite.dimensions(/* gfx */).h
| ~~~~~~~~~~~
error[E0609]: no field `h` on type `Option<Rect>`
--> src/bullet.rs:112:34
|
112 | self.sprite.dimensions().h
| ^ unknown field
|
help: one of the expressions' fields has a field of the same name
|
112 | self.sprite.dimensions().unwrap().h
| +++++++++
error[E0061]: this method takes 1 argument but 0 arguments were supplied
--> src/main.rs:53:34
|
53 | self.pos.0 - self.sprite.dimensions().w as f32 / 2.0
| ^^^^^^^^^^-- an argument of type `&_` is missing
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/draw.rs:299:8
|
299 | fn dimensions(&self, gfx: &impl Has<GraphicsContext>) -> Option<Rect>;
| ^^^^^^^^^^
help: provide the argument
|
53 | self.pos.0 - self.sprite.dimensions(/* gfx */).w as f32 / 2.0
| ~~~~~~~~~~~
error[E0609]: no field `w` on type `Option<Rect>`
--> src/main.rs:53:47
|
53 | self.pos.0 - self.sprite.dimensions().w as f32 / 2.0
| ^ unknown field
|
help: one of the expressions' fields has a field of the same name
|
53 | self.pos.0 - self.sprite.dimensions().unwrap().w as f32 / 2.0
| +++++++++
error[E0061]: this method takes 1 argument but 0 arguments were supplied
--> src/main.rs:57:34
|
57 | self.pos.1 - self.sprite.dimensions().h as f32 / 2.0
| ^^^^^^^^^^-- an argument of type `&_` is missing
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/draw.rs:299:8
|
299 | fn dimensions(&self, gfx: &impl Has<GraphicsContext>) -> Option<Rect>;
| ^^^^^^^^^^
help: provide the argument
|
57 | self.pos.1 - self.sprite.dimensions(/* gfx */).h as f32 / 2.0
| ~~~~~~~~~~~
error[E0609]: no field `h` on type `Option<Rect>`
--> src/main.rs:57:47
|
57 | self.pos.1 - self.sprite.dimensions().h as f32 / 2.0
| ^ unknown field
|
help: one of the expressions' fields has a field of the same name
|
57 | self.pos.1 - self.sprite.dimensions().unwrap().h as f32 / 2.0
| +++++++++
error[E0061]: this method takes 1 argument but 0 arguments were supplied
--> src/main.rs:61:21
|
61 | self.sprite.dimensions().w
| ^^^^^^^^^^-- an argument of type `&_` is missing
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/draw.rs:299:8
|
299 | fn dimensions(&self, gfx: &impl Has<GraphicsContext>) -> Option<Rect>;
| ^^^^^^^^^^
help: provide the argument
|
61 | self.sprite.dimensions(/* gfx */).w
| ~~~~~~~~~~~
error[E0609]: no field `w` on type `Option<Rect>`
--> src/main.rs:61:34
|
61 | self.sprite.dimensions().w
| ^ unknown field
|
help: one of the expressions' fields has a field of the same name
|
61 | self.sprite.dimensions().unwrap().w
| +++++++++
error[E0061]: this method takes 1 argument but 0 arguments were supplied
--> src/main.rs:65:21
|
65 | self.sprite.dimensions().h
| ^^^^^^^^^^-- an argument of type `&_` is missing
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/draw.rs:299:8
|
299 | fn dimensions(&self, gfx: &impl Has<GraphicsContext>) -> Option<Rect>;
| ^^^^^^^^^^
help: provide the argument
|
65 | self.sprite.dimensions(/* gfx */).h
| ~~~~~~~~~~~
error[E0609]: no field `h` on type `Option<Rect>`
--> src/main.rs:65:34
|
65 | self.sprite.dimensions().h
| ^ unknown field
|
help: one of the expressions' fields has a field of the same name
|
65 | self.sprite.dimensions().unwrap().h
| +++++++++
error[E0624]: associated function `new` is private
--> src/main.rs:120:50
|
120 | alien_idle: Rc::new(graphics::Image::new(ctx, "/ENEMY.png")?),
| ^^^ private associated function
|
::: /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/image.rs:161:5
|
161 | / fn new(
162 | | wgpu: &WgpuContext,
163 | | format: ImageFormat,
164 | | width: u32,
... |
167 | | usage: wgpu::TextureUsages,
168 | | ) -> Self {
| |_____________- private associated function defined here
error[E0061]: this function takes 6 arguments but 2 arguments were supplied
--> src/main.rs:120:33
|
120 | alien_idle: Rc::new(graphics::Image::new(ctx, "/ENEMY.png")?),
| ^^^^^^^^^^^^^^^^^^^^-------------------
| || |
| || expected `TextureFormat`, found `&str`
| |expected `&WgpuContext`, found `&mut Context`
| multiple arguments are missing
|
= note: expected reference `&WgpuContext`
found mutable reference `&mut ggez::Context`
note: associated function defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/image.rs:161:8
|
161 | fn new(
| ^^^
help: provide the arguments
|
120 | alien_idle: Rc::new(graphics::Image::new(/* &WgpuContext */, /* wgpu_types::TextureFormat */, /* u32 */, /* u32 */, /* u32 */, /* wgpu_types::TextureUsages */)?),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> src/main.rs:120:33
|
120 | alien_idle: Rc::new(graphics::Image::new(ctx, "/ENEMY.png")?),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `Image`
|
= help: the trait `Try` is not implemented for `Image`
error[E0624]: associated function `new` is private
--> src/main.rs:121:52
|
121 | alien_firing: Rc::new(graphics::Image::new(ctx, "/ENEMY_FIRING.png")?),
| ^^^ private associated function
|
::: /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/image.rs:161:5
|
161 | / fn new(
162 | | wgpu: &WgpuContext,
163 | | format: ImageFormat,
164 | | width: u32,
... |
167 | | usage: wgpu::TextureUsages,
168 | | ) -> Self {
| |_____________- private associated function defined here
error[E0061]: this function takes 6 arguments but 2 arguments were supplied
--> src/main.rs:121:35
|
121 | alien_firing: Rc::new(graphics::Image::new(ctx, "/ENEMY_FIRING.png")?),
| ^^^^^^^^^^^^^^^^^^^^--------------------------
| || |
| || expected `TextureFormat`, found `&str`
| |expected `&WgpuContext`, found `&mut Context`
| multiple arguments are missing
|
= note: expected reference `&WgpuContext`
found mutable reference `&mut ggez::Context`
note: associated function defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/image.rs:161:8
|
161 | fn new(
| ^^^
help: provide the arguments
|
121 | alien_firing: Rc::new(graphics::Image::new(/* &WgpuContext */, /* wgpu_types::TextureFormat */, /* u32 */, /* u32 */, /* u32 */, /* wgpu_types::TextureUsages */)?),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> src/main.rs:121:35
|
121 | alien_firing: Rc::new(graphics::Image::new(ctx, "/ENEMY_FIRING.png")?),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `Image`
|
= help: the trait `Try` is not implemented for `Image`
error[E0624]: associated function `new` is private
--> src/main.rs:122:46
|
122 | player: Rc::new(graphics::Image::new(ctx, "/PLAYER_OLD_2.png")?),
| ^^^ private associated function
|
::: /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/image.rs:161:5
|
161 | / fn new(
162 | | wgpu: &WgpuContext,
163 | | format: ImageFormat,
164 | | width: u32,
... |
167 | | usage: wgpu::TextureUsages,
168 | | ) -> Self {
| |_____________- private associated function defined here
error[E0061]: this function takes 6 arguments but 2 arguments were supplied
--> src/main.rs:122:29
|
122 | player: Rc::new(graphics::Image::new(ctx, "/PLAYER_OLD_2.png")?),
| ^^^^^^^^^^^^^^^^^^^^--------------------------
| || |
| || expected `TextureFormat`, found `&str`
| |expected `&WgpuContext`, found `&mut Context`
| multiple arguments are missing
|
= note: expected reference `&WgpuContext`
found mutable reference `&mut ggez::Context`
note: associated function defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/image.rs:161:8
|
161 | fn new(
| ^^^
help: provide the arguments
|
122 | player: Rc::new(graphics::Image::new(/* &WgpuContext */, /* wgpu_types::TextureFormat */, /* u32 */, /* u32 */, /* u32 */, /* wgpu_types::TextureUsages */)?),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> src/main.rs:122:29
|
122 | player: Rc::new(graphics::Image::new(ctx, "/PLAYER_OLD_2.png")?),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `Image`
|
= help: the trait `Try` is not implemented for `Image`
error[E0624]: associated function `new` is private
--> src/main.rs:123:50
|
123 | red_bullet: Rc::new(graphics::Image::new(ctx, "/Red_Missile.png")?),
| ^^^ private associated function
|
::: /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/image.rs:161:5
|
161 | / fn new(
162 | | wgpu: &WgpuContext,
163 | | format: ImageFormat,
164 | | width: u32,
... |
167 | | usage: wgpu::TextureUsages,
168 | | ) -> Self {
| |_____________- private associated function defined here
error[E0061]: this function takes 6 arguments but 2 arguments were supplied
--> src/main.rs:123:33
|
123 | red_bullet: Rc::new(graphics::Image::new(ctx, "/Red_Missile.png")?),
| ^^^^^^^^^^^^^^^^^^^^-------------------------
| || |
| || expected `TextureFormat`, found `&str`
| |expected `&WgpuContext`, found `&mut Context`
| multiple arguments are missing
|
= note: expected reference `&WgpuContext`
found mutable reference `&mut ggez::Context`
note: associated function defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/image.rs:161:8
|
161 | fn new(
| ^^^
help: provide the arguments
|
123 | red_bullet: Rc::new(graphics::Image::new(/* &WgpuContext */, /* wgpu_types::TextureFormat */, /* u32 */, /* u32 */, /* u32 */, /* wgpu_types::TextureUsages */)?),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> src/main.rs:123:33
|
123 | red_bullet: Rc::new(graphics::Image::new(ctx, "/Red_Missile.png")?),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `Image`
|
= help: the trait `Try` is not implemented for `Image`
error[E0624]: associated function `new` is private
--> src/main.rs:124:52
|
124 | green_bullet: Rc::new(graphics::Image::new(ctx, "/MISSILE_FIRED.png")?),
| ^^^ private associated function
|
::: /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/image.rs:161:5
|
161 | / fn new(
162 | | wgpu: &WgpuContext,
163 | | format: ImageFormat,
164 | | width: u32,
... |
167 | | usage: wgpu::TextureUsages,
168 | | ) -> Self {
| |_____________- private associated function defined here
error[E0061]: this function takes 6 arguments but 2 arguments were supplied
--> src/main.rs:124:35
|
124 | green_bullet: Rc::new(graphics::Image::new(ctx, "/MISSILE_FIRED.png")?),
| ^^^^^^^^^^^^^^^^^^^^---------------------------
| || |
| || expected `TextureFormat`, found `&str`
| |expected `&WgpuContext`, found `&mut Context`
| multiple arguments are missing
|
= note: expected reference `&WgpuContext`
found mutable reference `&mut ggez::Context`
note: associated function defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/image.rs:161:8
|
161 | fn new(
| ^^^
help: provide the arguments
|
124 | green_bullet: Rc::new(graphics::Image::new(/* &WgpuContext */, /* wgpu_types::TextureFormat */, /* u32 */, /* u32 */, /* u32 */, /* wgpu_types::TextureUsages */)?),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> src/main.rs:124:35
|
124 | green_bullet: Rc::new(graphics::Image::new(ctx, "/MISSILE_FIRED.png")?),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `Image`
|
= help: the trait `Try` is not implemented for `Image`
error[E0624]: associated function `new` is private
--> src/main.rs:125:50
|
125 | background: Rc::new(graphics::Image::new(ctx, "/Space.png")?),
| ^^^ private associated function
|
::: /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/image.rs:161:5
|
161 | / fn new(
162 | | wgpu: &WgpuContext,
163 | | format: ImageFormat,
164 | | width: u32,
... |
167 | | usage: wgpu::TextureUsages,
168 | | ) -> Self {
| |_____________- private associated function defined here
error[E0061]: this function takes 6 arguments but 2 arguments were supplied
--> src/main.rs:125:33
|
125 | background: Rc::new(graphics::Image::new(ctx, "/Space.png")?),
| ^^^^^^^^^^^^^^^^^^^^-------------------
| || |
| || expected `TextureFormat`, found `&str`
| |expected `&WgpuContext`, found `&mut Context`
| multiple arguments are missing
|
= note: expected reference `&WgpuContext`
found mutable reference `&mut ggez::Context`
note: associated function defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/image.rs:161:8
|
161 | fn new(
| ^^^
help: provide the arguments
|
125 | background: Rc::new(graphics::Image::new(/* &WgpuContext */, /* wgpu_types::TextureFormat */, /* u32 */, /* u32 */, /* u32 */, /* wgpu_types::TextureUsages */)?),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> src/main.rs:125:33
|
125 | background: Rc::new(graphics::Image::new(ctx, "/Space.png")?),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `Image`
|
= help: the trait `Try` is not implemented for `Image`
error[E0061]: this method takes 1 argument but 0 arguments were supplied
--> src/main.rs:257:30
|
257 | game.audio.bloop.play()?;
| ^^^^-- an argument of type `&_` is missing
|
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/audio.rs:131:8
|
131 | fn play(&mut self, audio: &impl Has<AudioContext>) -> GameResult {
| ^^^^
help: provide the argument
|
257 | game.audio.bloop.play(/* audio */)?;
| ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> src/main.rs:274:34
|
274 | game.sprites.background.draw(ctx, DrawParam::default())
| ---- ^^^ expected `&mut Canvas`, found `&mut Context`
| |
| arguments to this method are incorrect
|
= note: expected mutable reference `&mut Canvas`
found mutable reference `&mut ggez::Context`
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/draw.rs:293:8
|
293 | fn draw(&self, canvas: &mut Canvas, param: impl Into<DrawParam>);
| ^^^^
error[E0308]: mismatched types
--> src/main.rs:274:5
|
273 | fn draw_background(ctx: &mut Context, game: &Game) -> GameResult<()> {
| -------------- expected `Result<(), GameError>` because of return type
274 | game.sprites.background.draw(ctx, DrawParam::default())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Result<(), GameError>`, found `()`
|
= note: expected enum `Result<(), GameError>`
found unit type `()`
help: try adding an expression at the end of the block
|
274 ~ game.sprites.background.draw(ctx, DrawParam::default());
275 + Ok(())
|
error[E0308]: mismatched types
--> src/main.rs:290:9
|
289 | game.sprites.player.draw(
| ---- arguments to this method are incorrect
290 | ctx,
| ^^^ expected `&mut Canvas`, found `&mut Context`
|
= note: expected mutable reference `&mut Canvas`
found mutable reference `&mut ggez::Context`
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/draw.rs:293:8
|
293 | fn draw(&self, canvas: &mut Canvas, param: impl Into<DrawParam>);
| ^^^^
error[E0308]: mismatched types
--> src/main.rs:289:5
|
288 | fn draw_player(ctx: &mut Context, game: &Game) -> GameResult<()> {
| -------------- expected `Result<(), GameError>` because of return type
289 | / game.sprites.player.draw(
290 | | ctx,
291 | | DrawParam::default()
292 | | .offset(Point2::new(0.5, 0.5))
293 | | .dest(Point2::new(game.player.pos.0, game.player.pos.1))
294 | | .rotation(FRAC_PI_2),
295 | | )
| |_____^ expected `Result<(), GameError>`, found `()`
|
= note: expected enum `Result<(), GameError>`
found unit type `()`
help: try adding an expression at the end of the block
|
295 ~ );
296 + Ok(())
|
error[E0308]: mismatched types
--> src/main.rs:301:9
|
300 | text.draw(
| ---- arguments to this method are incorrect
301 | ctx,
| ^^^ expected `&mut Canvas`, found `&mut Context`
|
= note: expected mutable reference `&mut Canvas`
found mutable reference `&mut ggez::Context`
note: method defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/graphics/draw.rs:293:8
|
293 | fn draw(&self, canvas: &mut Canvas, param: impl Into<DrawParam>);
| ^^^^
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> src/main.rs:300:5
|
300 | / text.draw(
301 | | ctx,
302 | | DrawParam::default().dest(Point2::new(
303 | | game.screen_size.0 as f32 / 2.0,
304 | | game.screen_size.1 as f32 / 2.0,
305 | | )),
306 | | )?;
| |______^ the `?` operator cannot be applied to type `()`
|
= help: the trait `Try` is not implemented for `()`
error[E0277]: the trait bound `&mut Game: EventHandler<_>` is not satisfied
--> src/main.rs:375:43
|
375 | event::run(&mut ctx, &mut event_loop, &mut my_game)?;
| ---------- ^^^^^^^^^^^^ the trait `EventHandler<_>` is not implemented for `&mut Game`
| |
| required by a bound introduced by this call
|
note: required by a bound in `run`
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/event.rs:283:8
|
281 | pub fn run<S: 'static, E>(mut ctx: Context, event_loop: EventLoop<()>, mut state: S) -> !
| --- required by a bound in this function
282 | where
283 | S: EventHandler<E>,
| ^^^^^^^^^^^^^^^ required by this bound in `run`
help: consider removing the leading `&`-reference
|
375 - event::run(&mut ctx, &mut event_loop, &mut my_game)?;
375 + event::run(&mut ctx, &mut event_loop, my_game)?;
|
error[E0308]: arguments to this function are incorrect
--> src/main.rs:375:5
|
375 | event::run(&mut ctx, &mut event_loop, &mut my_game)?;
| ^^^^^^^^^^ -------- expected `Context`, found `&mut Context`
|
note: expected `EventLoop<()>`, found `&mut EventLoop<()>`
--> src/main.rs:375:26
|
375 | event::run(&mut ctx, &mut event_loop, &mut my_game)?;
| ^^^^^^^^^^^^^^^
= note: expected struct `EventLoop<_>`
found mutable reference `&mut EventLoop<_>`
note: function defined here
--> /Users/emccue/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ggez-0.9.3/src/event.rs:281:8
|
281 | pub fn run<S: 'static, E>(mut ctx: Context, event_loop: EventLoop<()>, mut state: S) -> !
| ^^^
help: consider removing the borrow
|
375 - event::run(&mut ctx, &mut event_loop, &mut my_game)?;
375 + event::run(ctx, &mut event_loop, &mut my_game)?;
|
help: consider removing the borrow
|
375 - event::run(&mut ctx, &mut event_loop, &mut my_game)?;
375 + event::run(&mut ctx, event_loop, &mut my_game)?;
|
warning: unreachable call
--> src/main.rs:375:5
|
375 | event::run(&mut ctx, &mut event_loop, &mut my_game)?;
| ---------------------------------------------------^
| |
| unreachable call
| any code following this expression is unreachable
|
= note: `#[warn(unreachable_code)]` on by default
warning: unused import: `BulletFactory`
--> src/main.rs:26:29
|
26 | use crate::bullet::{Bullet, BulletFactory, BulletFactoryImpl};
| ^^^^^^^^^^^^^
Some errors have detailed explanations: E0050, E0053, E0061, E0277, E0308, E0425, E0432, E0603, E0609...
For more information about an error, try `rustc --explain E0050`.
warning: `rustisbetter` (bin "rustisbetter") generated 11 warnings
error: could not compile `rustisbetter` (bin "rustisbetter") due to 61 previous errors; 11 warnings emitted
Guess they really took ZeroVer to heart, huh?
So as it stands I have no clue how to run this Rust project on my Laptop.