1 // Issue 22443: Reject code using non-regular types that would
2 // otherwise cause dropck to loop infinitely.
4 // This version is just checking that we still sanely handle a trivial
5 // wrapper around the non-regular type. (It also demonstrates how the
6 // error messages will report different types depending on which type
7 // dropck is analyzing.)
9 use std::marker::PhantomData;
15 struct Node<T:'static> { m: PhantomData<&'static T> }
17 enum FingerTree<T:'static> {
19 // According to the bug report, Digit before Box would infinite loop.
22 Box<FingerTree<Node<T>>>,
26 enum Wrapper<T:'static> {
32 let w = //~ ERROR overflow while adding drop-check rules for Option
33 Some(Wrapper::Simple::<u32>);
34 //~^ ERROR overflow while adding drop-check rules for Option
35 //~| ERROR overflow while adding drop-check rules for Wrapper