Skip to content

Commit 8d2c975

Browse files
committed
Add an extra note to Export's diagnostic::on_unimplemented informing about #[export] of Gd<T> or DynGd<T, D>.
1 parent 47cc8da commit 8d2c975

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

godot-core/src/registry/property.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ pub trait Var: GodotConvert {
6464
#[diagnostic::on_unimplemented(
6565
message = "`#[var]` properties require `Var` trait; #[export] ones require `Export` trait",
6666
label = "type cannot be used as a property",
67-
note = "see also: https://godot-rust.github.io/book/register/properties.html"
67+
note = "see also: https://godot-rust.github.io/book/register/properties.html",
68+
note = "`Gd` and `DynGd` cannot be used directly as properties because they are non-nullable. In such a case use `OnEditor<T>` or `Option<T>` instead."
6869
)]
6970
pub trait Export: Var {
7071
/// The export info to use for an exported field of this type, if no other export info is specified.

0 commit comments

Comments
 (0)