Skip to content

bevy implied bounds hack no longer works #164

Closed
@lcnr

Description

@lcnr

affected test

  • tests/ui/implied-bounds/bevy_world_query.rs

somewhat unsure about why this happens, but

// Needed due to <https://github.com/rust-lang/rust/pull/137253>.
#![crate_name = "bevy_ecs"]

pub trait WorldQuery {}
impl WorldQuery for &u8 {}

pub struct Query<Q: WorldQuery>(Q);

pub trait SystemParam {
    type State;
}
impl<Q: WorldQuery + 'static> SystemParam for Query<Q> {
    type State = ();
    // `Q: 'static` is required because we need the TypeId of Q ...
}

pub struct ParamSet<T: SystemParam>(T) where T::State: Sized;

fn handler<'a>(x: ParamSet<Query<&'a u8>>) {
    let _: ParamSet<_> = x;
}

fn ref_handler<'a>(_: &ParamSet<Query<&'a u8>>) {}

now errors with "the type &'a u8 does not fulfill the required lifetime"

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions