Skip to content

Add #[diagnostic::do_not_recommend] to blanket impl of HasField#74

Merged
soareschen merged 2 commits intomainfrom
diagnostic-do-not-recommend
Feb 22, 2025
Merged

Add #[diagnostic::do_not_recommend] to blanket impl of HasField#74
soareschen merged 2 commits intomainfrom
diagnostic-do-not-recommend

Conversation

@soareschen
Copy link
Collaborator

@soareschen soareschen commented Feb 22, 2025

Summary

This PR adds the new #[diagnostic::do_not_recommend] attribute from Rust 1.85 to the blanket implementations of HasField and HasFieldMut.

With this improvement, users would get much less confusing messages about Deref not being implemented, when what really happen is just that the given field accessor is not preset.

Other Blanket Implementations

I have also tried applying #[diagnostic::do_not_recommend] to other CGP blanket implementations, in particular the blanket implementations for the consumer trait and provider trait that use HasProvider and DelegateComponent. However doing so completely remove any relevant information about the unsatisfied constraint. So unfortunately we cannot use #[diagnostic::do_not_recommend] to improve the error messages there.

Deferred Upgrade to Rust 1.85

Note that we cannot fully upgrade to Rust 1.85 and the 2024 edition yet, as Wasmer currently support only up to Rust 1.81 due to broken support of Wasm reference types introduced in Rust 1.82. As a result, we can only upgrade after Wasmer and its downstream dependents are fixed.

@soareschen soareschen merged commit 5a6e0c8 into main Feb 22, 2025
5 checks passed
@soareschen soareschen deleted the diagnostic-do-not-recommend branch February 22, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant