Skip to content

Commit

Permalink
Fix compilation when some features are disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Shatur committed Oct 9, 2024
1 parent f95d814 commit ca7b0a2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: Clippy
run: cargo clippy --tests --examples -- -D warnings
run: cargo clippy --all-features --tests --examples -- -D warnings

- name: Rustdoc
run: cargo rustdoc -- -D warnings
Expand All @@ -68,6 +68,25 @@ jobs:
- name: Test doc
run: cargo test --no-default-features --doc

feature-combinations:
name: Feature combinations
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4

- name: Instal stable toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache crates
uses: Swatinem/rust-cache@v2

- name: Install Cargo Hack
run: cargo install cargo-hack

- name: Check feature combinations
run: cargo hack check --feature-powerset

test:
name: Test
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions src/input_reader.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::marker::PhantomData;

use bevy::{
ecs::system::SystemParam,
input::{
Expand Down Expand Up @@ -238,6 +240,8 @@ impl InputReader<'_, '_> {

#[derive(SystemParam)]
pub struct UiInput<'w, 's> {
/// Marker to make the struct compile even when all features are disabled.
marker: PhantomData<(&'w (), &'s ())>,
#[cfg(feature = "ui_priority")]
interactions: Query<'w, 's, &'static Interaction>,
#[cfg(feature = "egui_priority")]
Expand Down

0 comments on commit ca7b0a2

Please sign in to comment.