@@ -31,7 +31,7 @@ pub trait Query {
3131pub type QueryItem < ' a , Q > = <<Q as Query >:: Fetch as Fetch < ' a > >:: Item ;
3232
3333/// Streaming iterators over contiguous homogeneous ranges of components
34- pub trait Fetch < ' a > : Sized {
34+ pub unsafe trait Fetch < ' a > : Sized {
3535 /// Type of value to be fetched
3636 type Item ;
3737
@@ -76,7 +76,7 @@ impl<'a, T: Component> Query for &'a T {
7676#[ doc( hidden) ]
7777pub struct FetchRead < T > ( NonNull < T > ) ;
7878
79- impl < ' a , T : Component > Fetch < ' a > for FetchRead < T > {
79+ unsafe impl < ' a , T : Component > Fetch < ' a > for FetchRead < T > {
8080 type Item = & ' a T ;
8181
8282 fn dangling ( ) -> Self {
@@ -113,7 +113,7 @@ impl<'a, T: Component> Query for &'a mut T {
113113#[ doc( hidden) ]
114114pub struct FetchWrite < T > ( NonNull < T > ) ;
115115
116- impl < ' a , T : Component > Fetch < ' a > for FetchWrite < T > {
116+ unsafe impl < ' a , T : Component > Fetch < ' a > for FetchWrite < T > {
117117 type Item = & ' a mut T ;
118118
119119 fn dangling ( ) -> Self {
@@ -150,7 +150,7 @@ impl<T: Query> Query for Option<T> {
150150#[ doc( hidden) ]
151151pub struct TryFetch < T > ( Option < T > ) ;
152152
153- impl < ' a , T : Fetch < ' a > > Fetch < ' a > for TryFetch < T > {
153+ unsafe impl < ' a , T : Fetch < ' a > > Fetch < ' a > for TryFetch < T > {
154154 type Item = Option < T :: Item > ;
155155
156156 fn dangling ( ) -> Self {
@@ -202,7 +202,7 @@ impl<T: Component, Q: Query> Query for Without<T, Q> {
202202#[ doc( hidden) ]
203203pub struct FetchWithout < T , F > ( F , PhantomData < fn ( T ) > ) ;
204204
205- impl < ' a , T : Component , F : Fetch < ' a > > Fetch < ' a > for FetchWithout < T , F > {
205+ unsafe impl < ' a , T : Component , F : Fetch < ' a > > Fetch < ' a > for FetchWithout < T , F > {
206206 type Item = F :: Item ;
207207
208208 fn dangling ( ) -> Self {
@@ -263,7 +263,7 @@ impl<T: Component, Q: Query> Query for With<T, Q> {
263263#[ doc( hidden) ]
264264pub struct FetchWith < T , F > ( F , PhantomData < fn ( T ) > ) ;
265265
266- impl < ' a , T : Component , F : Fetch < ' a > > Fetch < ' a > for FetchWith < T , F > {
266+ unsafe impl < ' a , T : Component , F : Fetch < ' a > > Fetch < ' a > for FetchWith < T , F > {
267267 type Item = F :: Item ;
268268
269269 fn dangling ( ) -> Self {
@@ -677,7 +677,7 @@ unsafe impl<'q, Q: Query> Sync for Batch<'q, Q> {}
677677
678678macro_rules! tuple_impl {
679679 ( $( $name: ident) ,* ) => {
680- impl <' a, $( $name: Fetch <' a>) ,* > Fetch <' a> for ( $( $name, ) * ) {
680+ unsafe impl <' a, $( $name: Fetch <' a>) ,* > Fetch <' a> for ( $( $name, ) * ) {
681681 type Item = ( $( $name:: Item , ) * ) ;
682682
683683 fn dangling( ) -> Self {
0 commit comments