+
Skip to content

Use T::Archived syntax instead of <T as Archive>::Archived #602

@tigerros

Description

@tigerros

Example issue:

#[derive(Archive, Deserialize, Serialize)]
#[rkyv(derive(Clone))] // error: the trait bound <T as Archive>::Archived: Clone is not satisfied
struct Foo<T>(T);

Can be fixed if the macro expansion uses:

struct ArchivedFoo<T>(T::Archived) where T: Archive

instead of:

struct ArchivedFoo<T>(<T as Archive>::Archived) where T: Archive

I was told this might be a Rust bug but all I know is that the first version should work and the second one doesn't 🤷

Metadata

Metadata

Assignees

No one assigned

    Labels

    language deficiencyBlocked on missing language or compiler features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载