Skip to content

Conversation

ttencate
Copy link
Contributor

@ttencate ttencate commented Sep 9, 2025

The type contains no data, so this is guaranteed to be safe.

@Bromeon
Copy link
Member

Bromeon commented Sep 9, 2025

@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1305

@Bromeon Bromeon added quality-of-life No new functionality, but improves ergonomics/internals c: register Register classes, functions and other symbols to GDScript labels Sep 9, 2025
@ttencate
Copy link
Contributor Author

ttencate commented Sep 9, 2025

But I guess you change this to any T, without the bounds?

Exactly.

My use case is to have a struct that implements Send, which contains some kind of string. My attempted solution was:

struct MyStruct {
    text_string: String,
    #[var(get = get_text)]
    text: PhantomVar<GString>,
}

This didn't work because GString does not implement Send, and therefore PhantomVar<GString> also doesn't.

The type contains no data, so this is guaranteed to be safe.
@ttencate ttencate force-pushed the feature/phantomvar_sync_send branch from 0726d3f to 98a802b Compare September 9, 2025 12:47
Copy link
Member

@Bromeon Bromeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@Bromeon Bromeon added this pull request to the merge queue Sep 9, 2025
Merged via the queue into godot-rust:master with commit c18ac14 Sep 9, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: register Register classes, functions and other symbols to GDScript quality-of-life No new functionality, but improves ergonomics/internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants