We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Suppose you wanted to write a tower-esque trait using RPITIT:
pub trait LocalService<Request> { type Response; type Error; async fn execute(self, request: Request) -> Result<Self::Response, Self::Error>; }
This now works, but if I want to use make to add a Send variant, the macro fails:
make
Send
error: expected `:` --> src/example.rs:1:30 | 1 | #[trait_variant::make(Service<Request>: Send)] | ^
Omitting the generic parameters yields a different error:
error[E0412]: cannot find type `Request` in this scope --> src/example.rs:6:37 | 6 | async fn execute(self, request: Request) -> Result<Self::Response, Self::Error>; | ^^^^^^^ not found in this scope | help: consider importing one of these items | 1 + use core::error::Request; | 1 + use std::error::Request; | error[E0107]: missing generics for trait `LocalService` --> src/example.rs:2:11 | 2 | pub trait LocalService<Request> { | ^^^^^^^^^^^^ expected 1 generic argument | note: trait defined here, with 1 generic parameter: `Request` --> src/example.rs:2:11 | 2 | pub trait LocalService<Request> { | ^^^^^^^^^^^^ ------- help: add missing generic argument | 2 | pub trait LocalService<Request><Request> { | +++++++++ error[E0107]: missing generics for trait `Service` --> src/example.rs:1:23 | 1 | #[trait_variant::make(Service: Send)] | ^^^^^^^ expected 1 generic argument | note: trait defined here, with 1 generic parameter: `Request` --> src/example.rs:1:23 | 1 | #[trait_variant::make(Service: Send)] | ^^^^^^^ 2 | pub trait LocalService<Request> { | ------- help: add missing generic argument | 1 | #[trait_variant::make(Service<Request>: Send)] | +++++++++
The text was updated successfully, but these errors were encountered:
Should this be closed?
Sorry, something went wrong.
No branches or pull requests
Suppose you wanted to write a tower-esque trait using RPITIT:
This now works, but if I want to use
make
to add aSend
variant, the macro fails:Omitting the generic parameters yields a different error:
The text was updated successfully, but these errors were encountered: