Content-Length: 24974 | pFad | https://doc.rust-lang.org/std/iter/../clone/../../../std/../error_codes/./E0320.html

E0320 - 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 E0320

Recursion limit reached while creating drop-check rules.

Example of erroneous code:

#![allow(unused)]
fn main() {
enum A<T> {
    B,
    C(T, Box<A<(T, T)>>)
}

fn foo<T>() {
    A::<T>::B; // error: overflow while adding drop-check rules for A<T>
}
}

The Rust compiler must be able to reason about how a type is Dropped, and by extension the types of its fields, to be able to generate the glue to properly drop a value. The code example above shows a type where this inference is impossible because it is recursive. Note that this is not the same as E0072, where a type has an infinite size; the type here has a finite size but any attempt to Drop it would recurse infinitely. For more information, read the Drop docs.

It is not possible to define a type with recursive drop-check rules. All such recursion must be removed.









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/iter/../clone/../../../std/../error_codes/./E0320.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy