bevy/crates/bevy_ecs/src/entity
BD103 4f2fa81cef
Add #[deprecated(since = "0.16.0", ...)] to items missing it (#18702)
# Objective

- The `#[deprecated]` attributes supports a `since` field, which
documents in which version an item was deprecated. This field is visible
in `rustdoc`.
- We inconsistently use `since` throughout the project.

For an example of what `since` renders as, take a look at
`ChildOf::get()`:

```rust
/// The parent entity of this child entity.
#[deprecated(since = "0.16.0", note = "Use child_of.parent() instead")]
#[inline]
pub fn get(&self) -> Entity {
    self.0
}
```


![image](https://github.com/user-attachments/assets/2ea5d8c9-2eab-430a-9a1c-421f315ff123)


## Solution

- Add `since = "0.16.0"` to all `#[deprecated]` attributes that do not
already use it.
- Add an example of deprecating a struct with the `since` field in the
migration guide document.

I would appreciate if this could be included in 0.16's release, as its a
low-risk documentation improvement that is valuable for the release, but
I'd understand if this was cut.

## Testing

You can use `cargo doc` to inspect the rendered form of
`#[deprecated(since = "0.16.0", ...)]`.
2025-04-03 17:06:01 +00:00
..
clone_entities.rs Switch ChildOf back to tuple struct (#18672) 2025-04-02 00:10:10 +00:00
entity_set.rs use entity set collections type aliases instead of defaults (#18695) 2025-04-03 03:59:04 +00:00
hash_map.rs Rename EntityBorrow/TrustedEntityBorrow to ContainsEntity/EntityEquivalent (#18470) 2025-03-30 06:04:26 +00:00
hash_set.rs Implement Serialize/Deserialize for entity collections (#17620) 2025-02-02 15:42:36 +00:00
hash.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
index_map.rs Rename EntityBorrow/TrustedEntityBorrow to ContainsEntity/EntityEquivalent (#18470) 2025-03-30 06:04:26 +00:00
index_set.rs wrap EntityIndexMap/Set slices as well (#18134) 2025-03-17 18:42:18 +00:00
map_entities.rs reexport entity set collections in entity module (#18413) 2025-03-30 03:51:14 +00:00
mod.rs Add #[deprecated(since = "0.16.0", ...)] to items missing it (#18702) 2025-04-03 17:06:01 +00:00
unique_array.rs use entity set collections type aliases instead of defaults (#18695) 2025-04-03 03:59:04 +00:00
unique_slice.rs use entity set collections type aliases instead of defaults (#18695) 2025-04-03 03:59:04 +00:00
unique_vec.rs use entity set collections type aliases instead of defaults (#18695) 2025-04-03 03:59:04 +00:00