bevy::picking::events::Drop clashes with std::ops::Drop
What problem does this solve or what need does it fill?
Valid as of latest main (3cf70ba4f9d62396240b186ff379d27a312d2aa2).
#14686 Introduced a name clash when using use bevy::prelude::*;
-
std::ops::Dropis an already well-known type in the rust std, and is in the std prelude. -
bevy::picking::events::Dropis included in bevy's prelude.
Which causes this error:
error[E0404]: expected trait, found struct `Drop`
--> src\t.rs:5:6
|
5 | impl Drop for Foo {
| ^^^^ not a trait
|
help: consider importing one of these items instead
|
1 + use core::ops::Drop;
|
1 + use std::ops::Drop;
|
with:
use bevy::prelude::*;
pub struct Foo {}
impl Drop for Foo {
fn drop(&mut self) {}
}
What solution would you like?
Rename bevy::picking::events::Drop. No personal preference on what the new name should be.
If I might suggest an alternative name for bevy::picking::events::Drop... perhaps DropOnto? It stays just as explicit with what it's for (an event where something is dropped onto something else), while no longer conflicting with std::ops::Drop.
If that doesn't work, perhaps DragDrop, which sticks with the naming scheme of structs just above it (Drag followed by a suffix).
+1 to DragDrop
I thought I would name it Droppable, but then I realized, there is DragLeave, DragOver ... so DragDrop is a good match as it was mentioned in earlier comments.
I would like to pull request. Bear with me, it's my first pull request here and I haven't done very few PR overall. Suggestions or even dropping the pull request is fine. But please comment.