bevy/crates
JoJoJet f2f8f9097f Add safe constructors for untyped pointers Ptr and PtrMut (#6539)
# Objective

Currently, `Ptr` and `PtrMut` can only be constructed via unsafe code. This means that downgrading a reference to an untyped pointer is very cumbersome, despite being a very simple operation.

## Solution

Define conversions for easily and safely constructing untyped pointers. This is the non-owned counterpart to `OwningPtr::make`.

Before:

```rust
let ptr = unsafe { PtrMut::new(NonNull::from(&mut value).cast()) };
```

After:

```rust
let ptr = PtrMut::from(&mut value);
```


Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2022-11-14 22:53:50 +00:00
..
bevy_animation Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_app Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_asset Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_audio Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_core Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_core_pipeline Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_derive Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_diagnostic Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_dylib Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_dynamic_plugin Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_ecs Respect alignment for zero-sized types stored in the world (#6618) 2022-11-14 21:16:53 +00:00
bevy_ecs_compile_fail_tests Fix trybuild tests broken by rust 1.65 (#6457) 2022-11-03 15:09:27 +00:00
bevy_encase_derive Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_gilrs Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_gltf Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_hierarchy Fix Link in valid_parent_check_plugin.rs (#6584) 2022-11-13 15:35:48 +00:00
bevy_input Correct docs for ButtonSettingsError to read 0.0..=1.0 (#6570) 2022-11-12 22:59:49 +00:00
bevy_internal Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_log Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_macro_utils Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_math Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_mikktspace Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_pbr Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_ptr Add safe constructors for untyped pointers Ptr and PtrMut (#6539) 2022-11-14 22:53:50 +00:00
bevy_reflect Add safe constructors for untyped pointers Ptr and PtrMut (#6539) 2022-11-14 22:53:50 +00:00
bevy_render Add AutoMax next to ScalingMode::AutoMin (#6496) 2022-11-14 22:34:28 +00:00
bevy_scene Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_sprite Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_tasks Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_text Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_time Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_transform Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_ui Flip UI image (#6292) 2022-11-14 21:59:17 +00:00
bevy_utils Release 0.9.0 (#6568) 2022-11-12 20:01:29 +00:00
bevy_window Expose winit always_on_top (#6527) 2022-11-14 22:34:29 +00:00
bevy_winit Expose winit always_on_top (#6527) 2022-11-14 22:34:29 +00:00