-
Notifications
You must be signed in to change notification settings - Fork 3
Failed on trait with generic arguments. #2
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
I wanted to give blanket a try because, well, boilerplate. But:
#[ blanket(derive( Ref, Mut, Box, Rc )) ]
//
pub trait SpawnHandle<Out: 'static + Send>
{
...
}gave me:
error[E0658]: associated type bounds are unstable
--> src/iface/spawn_handle.rs:57:23
|
57 | pub trait SpawnHandle<Out: 'static + Send>
| ^^^^^^^^^^^^^^^^^^^
|
= note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
and
error[E0107]: missing generics for trait `spawn_handle::SpawnHandle`
--> src/iface/spawn_handle.rs:57:11
|
57 | pub trait SpawnHandle<Out: 'static + Send>
| ^^^^^^^^^^^ expected 1 type argument
|
note: trait defined here, with 1 type parameter: `Out`
--> src/iface/spawn_handle.rs:57:11
|
57 | pub trait SpawnHandle<Out: 'static + Send>
| ^^^^^^^^^^^ ---
help: use angle brackets to add missing type argument
|
57 | pub trait SpawnHandle<Out><Out: 'static + Send>
It generates:
impl<Out: 'static + Send, SH: SpawnHandle<Out: 'static + Send>>
SpawnHandle<Out: 'static + Send> for Box<SH>Where the manual implementation would do:
impl<T, Out> SpawnHandle<Out> for Box<T>
where T : SpawnHandle<Out> + ?Sized,
Out: 'static + SendSo it seems the issue is that the trait bounds on the generic type are repeated and they shouldn't.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working