Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ref::upcast should not require SafeAsRaw #1040

Open
chitoyuu opened this issue Mar 9, 2023 · 0 comments
Open

Ref::upcast should not require SafeAsRaw #1040

chitoyuu opened this issue Mar 9, 2023 · 0 comments
Labels

Comments

@chitoyuu
Copy link
Contributor

chitoyuu commented Mar 9, 2023

From DragonAxe via Discord:

So I thought I would try using Ref instead of Instance, but I'm running into this error:

   #[method]
   fn _ready(&self, #[base] owner: TRef<Label>) {
       CLIENT_STORE.with(|store| {
           let a = owner.claim().upcast::<Node>();
           store.my_sig.subscribe(a);
       });
   }
error[E0599]: the method `upcast` exists for struct `gdnative::prelude::Ref<Label>`, but its trait > bounds were not satisfied
   --> src/controls/connection_status_label.rs:21:35
    |
21  |             let a = owner.claim().upcast::<Node>();
    |                                   ^^^^^^ method cannot be called on `gdnative::prelude::Ref<Label>` due to unsatisfied trait bounds
    |
   ::: /home/dragonaxe/.cargo/registry/src/github.com-1ecc6299db9ec823/gdnative-core-0.11.2/src/object/bounds.rs:237:1
    |
237 | pub struct RefImplBound {
    | ----------------------- doesn't satisfy `RefImplBound: SafeAsRaw<ManuallyManaged, Shared>`
    |
    = note: the following trait bounds were not satisfied:
            `RefImplBound: SafeAsRaw<ManuallyManaged, Shared>`

Ref::upcast shouldn't require SafeAsRaw since it is statically determined and doesn't perform that action.

@chitoyuu chitoyuu added the bug label Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant