Open
Description
struct Holder<T>(T);
impl<T> Holder<T> {
fn as_type(&self) -> &T {
&self.0
}
}
trait CommitEncode {
fn commit_encode(&self);
}
impl<T: 'static> CommitEncode for Holder<&'static T>
where
T: CommitEncode,
{
fn commit_encode(&self) {
self.as_type().commit_encode();
}
}
impl<T: 'static> CommitEncode for T
where
T: Other,
Holder<&'static T>: CommitEncode,
{
fn commit_encode(&self) {
todo!()
}
}
trait Other {}
impl<T> Other for &T {}
fn main() {}
Metadata
Metadata
Assignees
Type
Projects
Status
unknown