-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use an actual type for the gui(Event = ...) attribute
The current implementation of gui-derive's Event attribute has the problem that the user specifies the event type to use in representation of a string. That is a problem for many reasons, two of which are: - when an event is used only in an attribute (by virtue of being a string there), the compiler will flag it as unused - type lookup (using the RLS) will simply not work as expected because a string looses all the type information It was not an accident that this functionality was implemented this way as the unrestricted_attribute_tokens feature, which allows for non-string tokens to be used as attributes, was unstable at the time this functionality was implemented, causing compilation errors such as the following: > error: expected unsuffixed literal or identifier, found Event2 > --> tests/test_derive.rs:38:7 > | > 38 | #[gui(Event = Event2)] > | ^^^^^ > | > = help: try enabling `#![feature(unrestricted_attribute_tokens)]` Now that [Rust issue 55208][issue-55208] has landed and reached the stable toolchain, this change implements the functionality properly. [issue-55208]: rust-lang/rust#55208
- Loading branch information
Showing
7 changed files
with
117 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters