repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_utils/src/parallel_queue.rs
crates/bevy_utils/src/parallel_queue.rs
use alloc::vec::Vec; use core::{cell::RefCell, ops::DerefMut}; use thread_local::ThreadLocal; /// A cohesive set of thread-local values of a given type. /// /// Mutable references can be fetched if `T: Default` via [`Parallel::scope`]. pub struct Parallel<T: Send> { locals: ThreadLocal<RefCell<T>>, } impl<T: Send...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_utils/src/default.rs
crates/bevy_utils/src/default.rs
/// An ergonomic abbreviation for [`Default::default()`] to make initializing structs easier. /// /// This is especially helpful when combined with ["struct update syntax"](https://doc.rust-lang.org/book/ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax). /// ``` /// use be...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_utils/src/map.rs
crates/bevy_utils/src/map.rs
use core::{any::TypeId, hash::Hash}; use bevy_platform::{ collections::{hash_map::Entry, HashMap}, hash::{Hashed, NoOpHash, PassHash}, }; /// A [`HashMap`] pre-configured to use [`Hashed`] keys and [`PassHash`] passthrough hashing. /// Iteration order only depends on the order of insertions and deletions. pub...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_utils/src/once.rs
crates/bevy_utils/src/once.rs
use bevy_platform::sync::atomic::{AtomicBool, Ordering}; /// Wrapper around an [`AtomicBool`], abstracting the backing implementation and /// ordering considerations. #[doc(hidden)] pub struct OnceFlag(AtomicBool); impl OnceFlag { /// Create a new flag in the unset state. pub const fn new() -> Self { ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_macro_utils/src/fq_std.rs
crates/bevy_macro_utils/src/fq_std.rs
//! This module contains unit structs that should be used inside `quote!` and `spanned_quote!` //! using the variable interpolation syntax in place of their equivalent structs and traits //! present in `std`. //! //! To create hygienic proc macros, all the names must be its fully qualified form. These //! unit structs ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_macro_utils/src/result_sifter.rs
crates/bevy_macro_utils/src/result_sifter.rs
/// Helper struct used to process an iterator of `Result<Vec<T>, syn::Error>`, /// combining errors into one along the way. pub struct ResultSifter<T> { items: Vec<T>, errors: Option<syn::Error>, } impl<T> Default for ResultSifter<T> { fn default() -> Self { Self { items: Vec::new(), ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_macro_utils/src/attrs.rs
crates/bevy_macro_utils/src/attrs.rs
use syn::{Expr, ExprLit, Lit}; use crate::symbol::Symbol; /// Get a [literal string](struct@syn::LitStr) from the provided [expression](Expr). pub fn get_lit_str(attr_name: Symbol, value: &Expr) -> syn::Result<&syn::LitStr> { if let Expr::Lit(ExprLit { lit: Lit::Str(lit), .. }) = &value { ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_macro_utils/src/shape.rs
crates/bevy_macro_utils/src/shape.rs
use syn::{ punctuated::Punctuated, spanned::Spanned, token::Comma, Data, DataEnum, DataUnion, Error, Field, Fields, }; /// Get the fields of a data structure if that structure is a struct; /// otherwise, return a compile error that points to the site of the macro invocation. /// /// `meta` should be the name o...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_macro_utils/src/lib.rs
crates/bevy_macro_utils/src/lib.rs
#![forbid(unsafe_code)] #![cfg_attr(docsrs, feature(doc_cfg))] #![doc( html_logo_url = "https://bevy.org/assets/icon.png", html_favicon_url = "https://bevy.org/assets/icon.png" )] //! A collection of helper types and functions for working on macros within the Bevy ecosystem. extern crate alloc; extern crate p...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_macro_utils/src/parser.rs
crates/bevy_macro_utils/src/parser.rs
use syn::{ parse::{Parse, ParseStream, Peek}, punctuated::Punctuated, }; /// Returns a [`syn::parse::Parser`] which parses a stream of zero or more occurrences of `T` /// separated by punctuation of type `P`, with optional trailing punctuation. /// /// This is functionally the same as [`Punctuated::parse_termi...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_macro_utils/src/bevy_manifest.rs
crates/bevy_macro_utils/src/bevy_manifest.rs
extern crate proc_macro; use alloc::collections::BTreeMap; use proc_macro::TokenStream; use std::sync::{PoisonError, RwLock}; use std::{ env, path::{Path, PathBuf}, time::SystemTime, }; use toml_edit::{Document, Item}; /// The path to the `Cargo.toml` file for the Bevy project. #[derive(Debug)] pub struct...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_macro_utils/src/label.rs
crates/bevy_macro_utils/src/label.rs
use proc_macro::{TokenStream, TokenTree}; use quote::{quote, quote_spanned}; use std::collections::HashSet; use syn::{spanned::Spanned, Ident}; /// Finds an identifier that will not conflict with the specified set of tokens. /// /// If the identifier is present in `haystack`, extra characters will be added /// to it u...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_macro_utils/src/member.rs
crates/bevy_macro_utils/src/member.rs
use syn::{Ident, Member}; /// Converts an optional identifier or index into a [`syn::Member`] variant. /// /// This is useful for when you want to access a field inside a `quote!` block regardless of whether it is an identifier or an index. /// There is also [`syn::Fields::members`], but this method doesn't work when ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_macro_utils/src/symbol.rs
crates/bevy_macro_utils/src/symbol.rs
use core::fmt::{self, Display}; use syn::{Ident, Path}; /// A single named value, representable as a [string](str). #[derive(Copy, Clone)] pub struct Symbol(pub &'static str); impl PartialEq<Symbol> for Ident { fn eq(&self, word: &Symbol) -> bool { self == word.0 } } impl<'a> PartialEq<Symbol> for &'...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/src/lib.rs
crates/bevy_ecs/compile_fail/src/lib.rs
// Nothing here, check out the integration tests
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui.rs
crates/bevy_ecs/compile_fail/tests/ui.rs
fn main() -> compile_fail_utils::ui_test::Result<()> { compile_fail_utils::test("ecs_ui", "tests/ui") }
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/query_exact_sized_iterator_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/query_exact_sized_iterator_safety.rs
use bevy_ecs::prelude::*; #[derive(Component)] struct Foo; fn on_changed(query: Query<&Foo, Changed<Foo>>) { is_exact_size_iterator(query.iter()); //~^ E0277 } fn on_added(query: Query<&Foo, Added<Foo>>) { is_exact_size_iterator(query.iter()); //~^ E0277 } fn is_exact_size_iterator<T: ExactSizeItera...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/system_query_iter_many_mut_lifetime_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/system_query_iter_many_mut_lifetime_safety.rs
use bevy_ecs::prelude::*; #[derive(Component)] struct A(usize); fn system(mut query: Query<&mut A>, e: Entity) { let mut results = Vec::new(); let mut iter = query.iter_many_mut([e, e]); //~v E0499 while let Some(a) = iter.fetch_next() { results.push(a); } }
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/query_iter_many_mut_iterator_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/query_iter_many_mut_iterator_safety.rs
use bevy_ecs::prelude::*; #[derive(Component)] struct A(usize); fn system(mut query: Query<&mut A>, e: Entity) { let iter = query.iter_many_mut([e]); is_iterator(iter) //~^ E0277 } fn is_iterator<T: Iterator>(_iter: T) {}
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/deconstruct_moving_ptr.rs
crates/bevy_ecs/compile_fail/tests/ui/deconstruct_moving_ptr.rs
//@no-rustfix use bevy_ecs::ptr::{deconstruct_moving_ptr, MovingPtr}; pub struct A { x: usize, } #[repr(packed)] pub struct B { x: usize, } fn test1( a: MovingPtr<A>, box_a: MovingPtr<Box<A>>, mut_a: MovingPtr<&mut A>, box_t1: MovingPtr<Box<(usize,)>>, mut_t1: MovingPtr<&mut (usize,)>, ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/entity_ref_mut_lifetime_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/entity_ref_mut_lifetime_safety.rs
use bevy_ecs::prelude::*; #[derive(Component, Eq, PartialEq, Debug)] struct A(Box<usize>); #[derive(Component)] struct B; fn main() { let mut world = World::default(); let e = world.spawn(A(Box::new(10_usize))).id(); let mut e_mut = world.entity_mut(e); { let gotten: &A = e_mut.get::<A>().u...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/component_hook_struct_path.rs
crates/bevy_ecs/compile_fail/tests/ui/component_hook_struct_path.rs
use bevy_ecs::prelude::*; // the proc macro allows general paths, which means normal structs are also passing the basic // parsing. This test makes sure that we don't accidentally allow structs as hooks through future // changes. // // Currently the error is thrown in the generated code and not while executing the pro...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/query_lens_lifetime_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/query_lens_lifetime_safety.rs
use bevy_ecs::prelude::*; use bevy_ecs::system::{QueryLens, SystemState}; #[derive(Component, Eq, PartialEq, Debug)] struct Foo(u32); #[derive(Component, Eq, PartialEq, Debug)] struct Bar(u32); fn main() { let mut world = World::default(); let e = world.spawn((Foo(10_u32), Bar(10_u32))).id(); let mut sy...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/component_hook_call_signature_mismatch.rs
crates/bevy_ecs/compile_fail/tests/ui/component_hook_call_signature_mismatch.rs
use bevy_ecs::prelude::*; // this should fail since the function is required to have the signature // (DeferredWorld, HookContext) -> () #[derive(Component)] //~^ E0057 #[component( on_add = wrong_bazzing("foo"), )] pub struct FooWrongCall; fn wrong_bazzing(_path: &str) -> impl Fn(bevy_ecs::world::DeferredWorld) ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/query_iter_combinations_mut_iterator_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/query_iter_combinations_mut_iterator_safety.rs
use bevy_ecs::prelude::*; #[derive(Component)] struct A(usize); fn system(mut query: Query<&mut A>) { let iter = query.iter_combinations_mut(); is_iterator(iter) //~^ E0277 } fn is_iterator<T: Iterator>(_iter: T) {}
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/system_state_iter_mut_overlap_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/system_state_iter_mut_overlap_safety.rs
use bevy_ecs::prelude::*; use bevy_ecs::system::SystemState; #[derive(Component, Eq, PartialEq, Debug, Clone, Copy)] struct A(usize); fn main() { let mut world = World::default(); world.spawn(A(1)); world.spawn(A(2)); let mut system_state = SystemState::<Query<&mut A>>::new(&mut world); { ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/system_query_set_get_lifetime_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/system_query_set_get_lifetime_safety.rs
use bevy_ecs::prelude::*; #[derive(Component)] struct A(usize); fn query_set(mut queries: ParamSet<(Query<&mut A>, Query<&A>)>, e: Entity) { let mut q2 = queries.p0(); let mut b = q2.get_mut(e).unwrap(); let q1 = queries.p1(); //~^ E0499 let a = q1.get(e).unwrap(); // this should fail to com...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/system_state_iter_lifetime_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/system_state_iter_lifetime_safety.rs
use bevy_ecs::prelude::*; use bevy_ecs::system::SystemState; #[derive(Component)] struct A(usize); #[derive(Component)] struct B(usize); struct State { state_r: SystemState<Query<'static, 'static, &'static A>>, state_w: SystemState<Query<'static, 'static, &'static mut A>>, } impl State { fn get_componen...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/resource_derive.rs
crates/bevy_ecs/compile_fail/tests/ui/resource_derive.rs
use bevy_ecs::prelude::*; #[derive(Resource)] //~v ERROR: Lifetimes must be 'static struct A<'a> { foo: &'a str, } #[derive(Resource)] struct B<'a: 'static> { foo: &'a str, }
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/system_query_iter_lifetime_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/system_query_iter_lifetime_safety.rs
use bevy_ecs::prelude::*; #[derive(Component)] struct A(usize); fn system(mut query: Query<&mut A>) { let mut iter = query.iter_mut(); let a = &mut *iter.next().unwrap(); let mut iter2 = query.iter_mut(); //~^ E0499 let _ = &mut *iter2.next().unwrap(); println!("{}", a.0); }
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/system_param_derive_readonly.rs
crates/bevy_ecs/compile_fail/tests/ui/system_param_derive_readonly.rs
use bevy_ecs::prelude::*; use bevy_ecs::system::{ReadOnlySystemParam, SystemParam, SystemState}; #[derive(Component)] struct Foo; #[derive(SystemParam)] struct Mutable<'w, 's> { a: Query<'w, 's, &'static mut Foo>, } fn main() { let mut world = World::default(); let state = SystemState::<Mutable>::new(&m...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/system_query_get_lifetime_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/system_query_get_lifetime_safety.rs
use bevy_ecs::prelude::*; #[derive(Component)] struct A(usize); fn system(mut query: Query<&mut A>, e: Entity) { let a1 = query.get_mut(e).unwrap(); let a2 = query.get_mut(e).unwrap(); //~^ E0499 println!("{} {}", a1.0, a2.0); }
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/world_query_derive.rs
crates/bevy_ecs/compile_fail/tests/ui/world_query_derive.rs
use bevy_ecs::prelude::*; use bevy_ecs::query::QueryData; #[derive(Component)] struct Foo; #[derive(QueryData)] struct MutableUnmarked { //~v E0277 a: &'static mut Foo, } #[derive(QueryData)] #[query_data(mut)] //~^ ERROR: invalid attribute, expected `mutable` or `derive` struct MutableInvalidAttribute { ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/system_query_set_iter_lifetime_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/system_query_set_iter_lifetime_safety.rs
use bevy_ecs::prelude::*; #[derive(Component)] struct A(usize); fn query_set(mut queries: ParamSet<(Query<&mut A>, Query<&A>)>) { let mut q2 = queries.p0(); let mut iter2 = q2.iter_mut(); let mut b = iter2.next().unwrap(); let q1 = queries.p1(); //~^ E0499 let mut iter = q1.iter(); let a ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/component_hook_relationship.rs
crates/bevy_ecs/compile_fail/tests/ui/component_hook_relationship.rs
use bevy_ecs::prelude::*; mod case1 { use super::*; #[derive(Component, Debug)] #[component(on_insert = foo_hook)] //~^ ERROR: Custom on_insert hooks are not supported as relationships already define an on_insert hook #[relationship(relationship_target = FooTargets)] pub struct FooTargetOfFail...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/system_query_get_many_lifetime_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/system_query_get_many_lifetime_safety.rs
use bevy_ecs::prelude::*; #[derive(Component)] struct A(usize); fn system(mut query: Query<&mut A>, e: Entity) { let a1 = query.get_many([e, e]).unwrap(); let a2 = query.get_mut(e).unwrap(); //~^ E0502 println!("{} {}", a1[0].0, a2.0); }
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/system_query_iter_sort_lifetime_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/system_query_iter_sort_lifetime_safety.rs
use bevy_ecs::prelude::*; use std::cmp::Ordering; #[derive(Component)] struct A(usize); fn system(mut query: Query<&mut A>) { let iter = query.iter_mut(); let mut stored: Option<&A> = None; let mut sorted = iter.sort_by::<&A>(|left, _right| { // Try to smuggle the lens item out of the closure. ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/query_transmute_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/query_transmute_safety.rs
use bevy_ecs::prelude::*; use bevy_ecs::system::SystemState; #[derive(Component, Eq, PartialEq, Debug)] struct Foo(u32); #[derive(Component)] struct Bar; fn main() { let mut world = World::default(); world.spawn(Foo(10)); let mut system_state = SystemState::<Query<(&mut Foo, &Bar)>>::new(&mut world); ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/query_to_readonly.rs
crates/bevy_ecs/compile_fail/tests/ui/query_to_readonly.rs
use bevy_ecs::prelude::*; #[derive(Component, Debug)] struct Foo; fn for_loops(mut query: Query<&mut Foo>) { // this should fail to compile for _ in query.iter_mut() { for _ in query.as_readonly().iter() {} //~^ E0502 } // this should fail to compile for _ in query.as_readonly().i...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/system_state_get_lifetime_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/system_state_get_lifetime_safety.rs
use bevy_ecs::prelude::*; use bevy_ecs::system::SystemState; #[derive(Component)] struct A(usize); #[derive(Component)] struct B(usize); struct State { state_r: SystemState<Query<'static, 'static, &'static A>>, state_w: SystemState<Query<'static, 'static, &'static mut A>>, } impl State { fn get_componen...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/query_lifetime_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/query_lifetime_safety.rs
use bevy_ecs::prelude::*; use bevy_ecs::system::SystemState; #[derive(Component, Eq, PartialEq, Debug)] struct Foo(u32); fn main() { let mut world = World::default(); let e = world.spawn(Foo(10_u32)).id(); let mut system_state = SystemState::<Query<&mut Foo>>::new(&mut world); { let mut query...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/bundle_on_drop_impl.rs
crates/bevy_ecs/compile_fail/tests/ui/bundle_on_drop_impl.rs
use bevy_ecs::prelude::*; #[derive(Component, Debug)] pub struct A(usize); // this should fail since destructuring T: Drop cannot be split. #[derive(Bundle, Debug)] //~^ E0509 pub struct DropBundle { component_a: A, } impl Drop for DropBundle { fn drop(&mut self) { // Just need the impl } }
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/compile_fail/tests/ui/system_query_get_many_mut_lifetime_safety.rs
crates/bevy_ecs/compile_fail/tests/ui/system_query_get_many_mut_lifetime_safety.rs
use bevy_ecs::prelude::*; #[derive(Component)] struct A(usize); fn system(mut query: Query<&mut A>, e: Entity) { let a1 = query.get_many_mut([e, e]).unwrap(); let a2 = query.get_mut(e).unwrap(); //~^ E0499 println!("{} {}", a1[0].0, a2.0); }
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/macros/src/event.rs
crates/bevy_ecs/macros/src/event.rs
use proc_macro::TokenStream; use quote::quote; use syn::{ parse_macro_input, parse_quote, spanned::Spanned, Data, DataStruct, DeriveInput, Fields, Index, Member, Path, Result, Token, Type, }; pub const EVENT: &str = "event"; pub const ENTITY_EVENT: &str = "entity_event"; pub const PROPAGATE: &str = "propagate"...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/macros/src/lib.rs
crates/bevy_ecs/macros/src/lib.rs
//! Macros for deriving ECS traits. #![cfg_attr(docsrs, feature(doc_cfg))] extern crate proc_macro; mod component; mod event; mod message; mod query_data; mod query_filter; mod world_query; use crate::{ component::map_entities, query_data::derive_query_data_impl, query_filter::derive_query_filter_impl, }; u...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/macros/src/query_filter.rs
crates/bevy_ecs/macros/src/query_filter.rs
use bevy_macro_utils::{ensure_no_collision, get_struct_fields}; use proc_macro::TokenStream; use proc_macro2::{Ident, Span}; use quote::{format_ident, quote}; use syn::{parse_macro_input, parse_quote, DeriveInput}; use crate::{bevy_ecs_path, world_query::world_query_impl}; mod field_attr_keywords { syn::custom_ke...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/macros/src/message.rs
crates/bevy_ecs/macros/src/message.rs
use proc_macro::TokenStream; use quote::quote; use syn::{parse_macro_input, parse_quote, DeriveInput, Path}; pub fn derive_message(input: TokenStream) -> TokenStream { let mut ast = parse_macro_input!(input as DeriveInput); let bevy_ecs_path: Path = crate::bevy_ecs_path(); ast.generics .make_where...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/macros/src/world_query.rs
crates/bevy_ecs/macros/src/world_query.rs
use proc_macro2::Ident; use quote::quote; use syn::{Attribute, Fields, ImplGenerics, Member, Type, TypeGenerics, Visibility, WhereClause}; pub(crate) fn item_struct( path: &syn::Path, fields: &Fields, derive_macro_call: &proc_macro2::TokenStream, struct_name: &Ident, visibility: &Visibility, it...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/macros/src/query_data.rs
crates/bevy_ecs/macros/src/query_data.rs
use bevy_macro_utils::{ensure_no_collision, get_struct_fields}; use proc_macro::TokenStream; use proc_macro2::{Ident, Span}; use quote::{format_ident, quote}; use syn::{ parse_macro_input, parse_quote, punctuated::Punctuated, token::Comma, DeriveInput, Meta, }; use crate::{ bevy_ecs_path, world_query::{ite...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/macros/src/component.rs
crates/bevy_ecs/macros/src/component.rs
use proc_macro::TokenStream; use proc_macro2::{Span, TokenStream as TokenStream2}; use quote::{format_ident, quote, ToTokens}; use std::collections::HashSet; use syn::{ braced, parenthesized, parse::Parse, parse_macro_input, parse_quote, punctuated::Punctuated, spanned::Spanned, token::{Brace, C...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/resource.rs
crates/bevy_ecs/src/resource.rs
//! Resources are unique, singleton-like data types that can be accessed from systems and stored in the [`World`](crate::world::World). // The derive macro for the `Resource` trait pub use bevy_ecs_macros::Resource; /// A type that can be inserted into a [`World`] as a singleton. /// /// You can access resource data ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/batching.rs
crates/bevy_ecs/src/batching.rs
//! Types for controlling batching behavior during parallel processing. use core::ops::Range; /// Dictates how a parallel operation chunks up large quantities /// during iteration. /// /// A parallel query will chunk up large tables and archetypes into /// chunks of at most a certain batch size. Similarly, a parallel...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/lib.rs
crates/bevy_ecs/src/lib.rs
#![doc = include_str!("../README.md")] #![cfg_attr( any(docsrs, docsrs_dep), expect( internal_features, reason = "rustdoc_internals is needed for fake_variadic" ) )] #![cfg_attr(any(docsrs, docsrs_dep), feature(doc_cfg, rustdoc_internals))] #![expect(unsafe_code, reason = "Unsafe code is use...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/hierarchy.rs
crates/bevy_ecs/src/hierarchy.rs
//! The canonical "parent-child" [`Relationship`] for entities, driven by //! the [`ChildOf`] [`Relationship`] and the [`Children`] [`RelationshipTarget`]. //! //! See [`ChildOf`] for a full description of the relationship and how to use it. //! //! [`Relationship`]: crate::relationship::Relationship //! [`Relationship...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/never.rs
crates/bevy_ecs/src/never.rs
//! A workaround for the `!` type in stable Rust. //! //! This approach is taken from the [`never_say_never`] crate, //! reimplemented here to avoid adding a new dependency. //! //! This module exists due to a change in [never type fallback inference] in the Rust 2024 edition. //! This caused failures in `bevy_ecs`'s t...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/spawn.rs
crates/bevy_ecs/src/spawn.rs
//! Entity spawning abstractions, largely focused on spawning related hierarchies of entities. See [`related`](crate::related) and [`SpawnRelated`] //! for the best entry points into these APIs and examples of how to use them. use crate::{ bundle::{Bundle, DynamicBundle, InsertMode, NoBundleEffect}, change_det...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/lifecycle.rs
crates/bevy_ecs/src/lifecycle.rs
//! This module contains various tools to allow you to react to component insertion or removal, //! as well as entity spawning and despawning. //! //! There are four main ways to react to these lifecycle events: //! //! 1. Using component hooks, which act as inherent constructors and destructors for components. //! 2. ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/archetype.rs
crates/bevy_ecs/src/archetype.rs
//! Types for defining [`Archetype`]s, collections of entities that have the same set of //! components. //! //! An archetype uniquely describes a group of entities that share the same components: //! a world only has one archetype for each unique combination of components, and all //! entities that have those componen...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/entity_disabling.rs
crates/bevy_ecs/src/entity_disabling.rs
//! Disabled entities do not show up in queries unless the query explicitly mentions them. //! //! Entities which are disabled in this way are not removed from the [`World`], //! and their relationships remain intact. //! In many cases, you may want to disable entire trees of entities at once, //! using [`EntityCommand...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/name.rs
crates/bevy_ecs/src/name.rs
//! Provides the [`Name`] [`Component`], used for identifying an [`Entity`]. use crate::{component::Component, entity::Entity, query::QueryData}; use alloc::{ borrow::{Cow, ToOwned}, string::String, }; use bevy_platform::hash::FixedHasher; use core::{ hash::{BuildHasher, Hash, Hasher}, ops::Deref, }; ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/intern.rs
crates/bevy_ecs/src/intern.rs
//! Provides types used to statically intern immutable values. //! //! Interning is a pattern used to save memory by deduplicating identical values, //! speed up code by shrinking the stack size of large types, //! and make comparisons for any type as fast as integers. use alloc::{borrow::ToOwned, boxed::Box}; use bev...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/traversal.rs
crates/bevy_ecs/src/traversal.rs
//! A trait for components that let you traverse the ECS. use crate::{ entity::Entity, query::{ReadOnlyQueryData, ReleaseStateQueryData}, relationship::Relationship, }; /// A component that can point to another entity, and which can be used to define a path through the ECS. /// /// Traversals are used to ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/label.rs
crates/bevy_ecs/src/label.rs
//! Traits used by label implementations use core::{ any::Any, hash::{Hash, Hasher}, }; // Re-exported for use within `define_label!` #[doc(hidden)] pub use alloc::boxed::Box; /// An object safe version of [`Eq`]. This trait is automatically implemented /// for any `'static` type that implements `Eq`. pub tr...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/storage/resource.rs
crates/bevy_ecs/src/storage/resource.rs
use crate::{ change_detection::{ CheckChangeTicks, ComponentTickCells, ComponentTicks, ComponentTicksMut, MaybeLocation, MutUntyped, Tick, }, component::{ComponentId, Components}, storage::{blob_array::BlobArray, SparseSet}, }; use bevy_ptr::{OwningPtr, Ptr, UnsafeCellDeref}; use bevy_ut...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/storage/sparse_set.rs
crates/bevy_ecs/src/storage/sparse_set.rs
use crate::{ change_detection::{CheckChangeTicks, ComponentTickCells, ComponentTicks, MaybeLocation, Tick}, component::{ComponentId, ComponentInfo}, entity::{Entity, EntityIndex}, query::DebugCheckedUnwrap, storage::{AbortOnPanic, Column, TableRow, VecExtensions}, }; use alloc::{boxed::Box, vec::Vec...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/storage/blob_array.rs
crates/bevy_ecs/src/storage/blob_array.rs
use alloc::alloc::handle_alloc_error; use bevy_ptr::{OwningPtr, Ptr, PtrMut}; use bevy_utils::OnDrop; use core::{alloc::Layout, cell::UnsafeCell, num::NonZeroUsize, ptr::NonNull}; /// A flat, type-erased data storage type. /// /// Used to densely store homogeneous ECS data. A blob is usually just an arbitrary block of...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/storage/thin_array_ptr.rs
crates/bevy_ecs/src/storage/thin_array_ptr.rs
use crate::query::DebugCheckedUnwrap; use alloc::alloc::{alloc, handle_alloc_error, realloc}; use core::{ alloc::Layout, mem::{needs_drop, size_of}, num::NonZeroUsize, ptr::{self, NonNull}, }; /// Similar to [`Vec<T>`], but with the capacity and length cut out for performance reasons. /// /// This type...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/storage/mod.rs
crates/bevy_ecs/src/storage/mod.rs
#![expect( unsafe_op_in_unsafe_fn, reason = "See #11590. To be removed once all applicable unsafe code has an unsafe block with a safety comment." )] //! Storage layouts for ECS data. //! //! This module implements the low-level collections that store data in a [`World`]. These all offer minimal and often //! ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/storage/table/column.rs
crates/bevy_ecs/src/storage/table/column.rs
use super::*; use crate::{ change_detection::MaybeLocation, storage::{blob_array::BlobArray, thin_array_ptr::ThinArrayPtr}, }; use core::{mem::needs_drop, panic::Location}; /// A type-erased contiguous container for data of a homogeneous type. /// /// Conceptually, a `Column` is very similar to a type-erased `...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/storage/table/mod.rs
crates/bevy_ecs/src/storage/table/mod.rs
use crate::{ change_detection::{CheckChangeTicks, ComponentTicks, MaybeLocation, Tick}, component::{ComponentId, ComponentInfo, Components}, entity::Entity, query::DebugCheckedUnwrap, storage::{AbortOnPanic, ImmutableSparseSet, SparseSet}, }; use alloc::{boxed::Box, vec, vec::Vec}; use bevy_platform...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/exclusive_system_param.rs
crates/bevy_ecs/src/system/exclusive_system_param.rs
use crate::{ prelude::{FromWorld, QueryState}, query::{QueryData, QueryFilter}, system::{Local, SystemMeta, SystemParam, SystemState}, world::World, }; use bevy_platform::cell::SyncCell; use core::marker::PhantomData; use variadics_please::all_tuples; /// A parameter that can be used in an exclusive sy...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/builder.rs
crates/bevy_ecs/src/system/builder.rs
use alloc::{boxed::Box, vec::Vec}; use bevy_platform::cell::SyncCell; use variadics_please::all_tuples; use crate::{ prelude::QueryBuilder, query::{QueryData, QueryFilter, QueryState}, resource::Resource, system::{ DynSystemParam, DynSystemParamState, If, Local, ParamSet, Query, SystemParam, ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/observer_system.rs
crates/bevy_ecs/src/system/observer_system.rs
use crate::{ event::Event, prelude::{Bundle, On}, system::System, }; use super::IntoSystem; /// Implemented for [`System`]s that have [`On`] as the first argument. pub trait ObserverSystem<E: Event, B: Bundle, Out = ()>: System<In = On<'static, 'static, E, B>, Out = Out> + Send + 'static { } impl<E: ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/combinator.rs
crates/bevy_ecs/src/system/combinator.rs
use alloc::{format, vec::Vec}; use bevy_utils::prelude::DebugName; use core::marker::PhantomData; use crate::{ change_detection::{CheckChangeTicks, Tick}, error::ErrorContext, prelude::World, query::FilteredAccessSet, schedule::InternedSystemSet, system::{input::SystemInput, SystemIn, SystemPar...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/adapter_system.rs
crates/bevy_ecs/src/system/adapter_system.rs
use alloc::vec::Vec; use bevy_utils::prelude::DebugName; use super::{IntoSystem, ReadOnlySystem, RunSystemError, System, SystemParamValidationError}; use crate::{ schedule::InternedSystemSet, system::{input::SystemInput, SystemIn}, world::unsafe_world_cell::UnsafeWorldCell, }; /// Customizes the behavior ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/system_registry.rs
crates/bevy_ecs/src/system/system_registry.rs
#[cfg(feature = "hotpatching")] use crate::{change_detection::DetectChanges, HotPatchChanges}; use crate::{ change_detection::Mut, entity::Entity, error::BevyError, system::{ input::SystemInput, BoxedSystem, IntoSystem, RunSystemError, SystemParamValidationError, }, world::World, }; use ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/function_system.rs
crates/bevy_ecs/src/system/function_system.rs
use crate::{ change_detection::{CheckChangeTicks, Tick}, error::{BevyError, Result}, never::Never, prelude::FromWorld, query::FilteredAccessSet, schedule::{InternedSystemSet, SystemSet}, system::{ check_system_change_tick, FromInput, ReadOnlySystemParam, System, SystemIn, SystemInput...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/system_name.rs
crates/bevy_ecs/src/system/system_name.rs
use crate::{ change_detection::Tick, prelude::World, query::FilteredAccessSet, system::{ExclusiveSystemParam, ReadOnlySystemParam, SystemMeta, SystemParam}, world::unsafe_world_cell::UnsafeWorldCell, }; use bevy_utils::prelude::DebugName; use derive_more::derive::{Display, Into}; /// [`SystemParam`...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/system.rs
crates/bevy_ecs/src/system/system.rs
#![expect( clippy::module_inception, reason = "This instance of module inception is being discussed; see #17353." )] use bevy_utils::prelude::DebugName; use bitflags::bitflags; use core::fmt::{Debug, Display}; use log::warn; use crate::{ change_detection::{CheckChangeTicks, Tick}, error::BevyError, ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/mod.rs
crates/bevy_ecs/src/system/mod.rs
//! Tools for controlling behavior in an ECS application. //! //! Systems define how an ECS based application behaves. //! Systems are added to a [`Schedule`](crate::schedule::Schedule), which is then run. //! A system is usually written as a normal function, which is automatically converted into a system. //! //! Syst...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/system_param.rs
crates/bevy_ecs/src/system/system_param.rs
#![expect( unsafe_op_in_unsafe_fn, reason = "See #11590. To be removed once all applicable unsafe code has an unsafe block with a safety comment." )] pub use crate::change_detection::{NonSend, NonSendMut, Res, ResMut}; use crate::{ archetype::Archetypes, bundle::Bundles, change_detection::{Componen...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/query.rs
crates/bevy_ecs/src/system/query.rs
use bevy_utils::prelude::DebugName; use crate::{ batching::BatchingStrategy, change_detection::Tick, entity::{Entity, EntityEquivalent, EntitySet, UniqueEntityArray}, query::{ DebugCheckedUnwrap, NopWorldQuery, QueryCombinationIter, QueryData, QueryEntityError, QueryFilter, QueryIter, Q...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/schedule_system.rs
crates/bevy_ecs/src/system/schedule_system.rs
use bevy_utils::prelude::DebugName; use crate::{ change_detection::{CheckChangeTicks, Tick}, error::Result, query::FilteredAccessSet, system::{input::SystemIn, BoxedSystem, RunSystemError, System, SystemInput}, world::{unsafe_world_cell::UnsafeWorldCell, DeferredWorld, FromWorld, World}, }; use su...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/input.rs
crates/bevy_ecs/src/system/input.rs
use core::ops::{Deref, DerefMut}; use variadics_please::all_tuples; use crate::{bundle::Bundle, event::Event, prelude::On, system::System}; /// Trait for types that can be used as input to [`System`]s. /// /// Provided implementations are: /// - `()`: No input /// - [`In<T>`]: For values /// - [`InRef<T>`]: For read...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/exclusive_function_system.rs
crates/bevy_ecs/src/system/exclusive_function_system.rs
use crate::{ change_detection::{CheckChangeTicks, Tick}, error::Result, query::FilteredAccessSet, schedule::{InternedSystemSet, SystemSet}, system::{ check_system_change_tick, ExclusiveSystemParam, ExclusiveSystemParamItem, IntoResult, IntoSystem, System, SystemIn, SystemInput, Syste...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/commands/entity_command.rs
crates/bevy_ecs/src/system/commands/entity_command.rs
//! Contains the definition of the [`EntityCommand`] trait, //! as well as the blanket implementation of the trait for closures. //! //! It also contains functions that return closures for use with //! [`EntityCommands`](crate::system::EntityCommands). use alloc::{string::ToString, vec::Vec}; #[cfg(not(feature = "trac...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/commands/command.rs
crates/bevy_ecs/src/system/commands/command.rs
//! Contains the definition of the [`Command`] trait, //! as well as the blanket implementation of the trait for closures. //! //! It also contains functions that return closures for use with //! [`Commands`](crate::system::Commands). use crate::{ bundle::{Bundle, InsertMode, NoBundleEffect}, change_detection:...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/commands/mod.rs
crates/bevy_ecs/src/system/commands/mod.rs
pub mod command; pub mod entity_command; #[cfg(feature = "std")] mod parallel_scope; use bevy_ptr::move_as_ptr; pub use command::Command; pub use entity_command::EntityCommand; #[cfg(feature = "std")] pub use parallel_scope::*; use alloc::boxed::Box; use core::marker::PhantomData; use crate::{ self as bevy_ecs...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/system/commands/parallel_scope.rs
crates/bevy_ecs/src/system/commands/parallel_scope.rs
use bevy_utils::Parallel; use crate::{ entity::{Entities, EntityAllocator}, prelude::World, system::{Deferred, SystemBuffer, SystemMeta, SystemParam}, }; use super::{CommandQueue, Commands}; #[derive(Default)] struct ParallelCommandQueue { thread_queues: Parallel<CommandQueue>, } /// An alternative ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/query/par_iter.rs
crates/bevy_ecs/src/query/par_iter.rs
use crate::{ batching::BatchingStrategy, change_detection::Tick, entity::{EntityEquivalent, UniqueEntityEquivalentVec}, world::unsafe_world_cell::UnsafeWorldCell, }; use super::{QueryData, QueryFilter, QueryItem, QueryState, ReadOnlyQueryData}; use alloc::vec::Vec; /// A parallel iterator over query ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/query/builder.rs
crates/bevy_ecs/src/query/builder.rs
use core::marker::PhantomData; use crate::{ component::{ComponentId, StorageType}, prelude::*, }; use super::{FilteredAccess, QueryData, QueryFilter}; /// Builder struct to create [`QueryState`] instances at runtime. /// /// ``` /// # use bevy_ecs::prelude::*; /// # /// # #[derive(Component)] /// # struct A;...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/query/filter.rs
crates/bevy_ecs/src/query/filter.rs
use crate::{ archetype::Archetype, change_detection::Tick, component::{Component, ComponentId, Components, StorageType}, entity::{Entities, Entity}, query::{DebugCheckedUnwrap, FilteredAccess, StorageSwitch, WorldQuery}, storage::{ComponentSparseSet, Table, TableRow}, world::{unsafe_world_ce...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/query/state.rs
crates/bevy_ecs/src/query/state.rs
use crate::{ archetype::{Archetype, ArchetypeGeneration, ArchetypeId}, change_detection::Tick, component::ComponentId, entity::{Entity, EntityEquivalent, EntitySet, UniqueEntityArray}, entity_disabling::DefaultQueryFilters, prelude::FromWorld, query::{FilteredAccess, QueryCombinationIter, Qu...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/query/error.rs
crates/bevy_ecs/src/query/error.rs
use bevy_utils::prelude::DebugName; use crate::{ archetype::ArchetypeId, entity::{Entity, EntityNotSpawnedError}, }; /// An error that occurs when retrieving a specific [`Entity`]'s query result from [`Query`](crate::system::Query) or [`QueryState`](crate::query::QueryState). // TODO: return the type_name as ...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/query/fetch.rs
crates/bevy_ecs/src/query/fetch.rs
use crate::{ archetype::{Archetype, Archetypes}, bundle::Bundle, change_detection::{ComponentTicksMut, ComponentTicksRef, MaybeLocation, Tick}, component::{Component, ComponentId, Components, Mutable, StorageType}, entity::{Entities, Entity, EntityLocation}, query::{ access_iter::{EcsAcc...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/query/access.rs
crates/bevy_ecs/src/query/access.rs
use crate::component::ComponentId; use crate::world::World; use alloc::{format, string::String, vec, vec::Vec}; use core::{fmt, fmt::Debug}; use derive_more::From; use fixedbitset::FixedBitSet; use thiserror::Error; /// A wrapper struct to make Debug representations of [`FixedBitSet`] easier /// to read. /// /// Inste...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/query/mod.rs
crates/bevy_ecs/src/query/mod.rs
#![expect( unsafe_op_in_unsafe_fn, reason = "See #11590. To be removed once all applicable unsafe code has an unsafe block with a safety comment." )] //! Contains APIs for retrieving component data from the world. mod access; mod access_iter; mod builder; mod error; mod fetch; mod filter; mod iter; mod par_it...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/query/access_iter.rs
crates/bevy_ecs/src/query/access_iter.rs
use core::fmt::Display; use crate::{ component::{ComponentId, Components}, query::{Access, QueryData}, }; /// Check if `Q` has any internal conflicts. #[inline(never)] pub fn has_conflicts<Q: QueryData>(components: &Components) -> Result<(), QueryAccessError> { // increasing this too much may slow down sm...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/query/iter.rs
crates/bevy_ecs/src/query/iter.rs
use super::{QueryData, QueryFilter, ReadOnlyQueryData}; use crate::{ archetype::{Archetype, ArchetypeEntity, Archetypes}, bundle::Bundle, change_detection::Tick, entity::{ContainsEntity, Entities, Entity, EntityEquivalent, EntitySet, EntitySetIterator}, query::{ArchetypeFilter, ArchetypeQueryData, D...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
true
bevyengine/bevy
https://github.com/bevyengine/bevy/blob/51a6fedb06a022ab5d39e099413caa882e1b022d/crates/bevy_ecs/src/query/world_query.rs
crates/bevy_ecs/src/query/world_query.rs
use crate::{ archetype::Archetype, change_detection::Tick, component::{ComponentId, Components}, query::FilteredAccess, storage::Table, world::{unsafe_world_cell::UnsafeWorldCell, World}, }; use variadics_please::all_tuples; /// Types that can be used as parameters in a [`Query`]. /// Types tha...
rust
Apache-2.0
51a6fedb06a022ab5d39e099413caa882e1b022d
2026-01-04T15:31:59.438636Z
false