Content-Length: 24240 | pFad | https://doc.rust-lang.org/std/pin/../cmp/../fs/../iter/../../../std/../../error_codes/./E0366.html

E0366 - Error codes index

Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Error code E0366

An attempt was made to implement Drop on a concrete specialization of a generic type. An example is shown below:

#![allow(unused)]
fn main() {
struct Foo<T> {
    t: T
}

impl Drop for Foo<u32> {
    fn drop(&mut self) {}
}
}

This code is not legal: it is not possible to specialize Drop to a subset of implementations of a generic type. One workaround for this is to wrap the generic type, as shown below:

#![allow(unused)]
fn main() {
struct Foo<T> {
    t: T
}

struct Bar {
    t: Foo<u32>
}

impl Drop for Bar {
    fn drop(&mut self) {}
}
}








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/std/pin/../cmp/../fs/../iter/../../../std/../../error_codes/./E0366.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy