3 // Regression test for #41936. The coerce-unsized trait check in
4 // coherence was using subtyping, which triggered variance
5 // computation, which failed because it required type info for fields
6 // that had not (yet) been computed.
9 #![feature(coerce_unsized)]
11 use std::{marker,ops};
13 // Change the array to a non-array, and error disappears
14 // Adding a new field to the end keeps the error
15 struct LogDataBuf([u8;8]);
17 struct Aref<T: ?Sized>
19 // Inner structure triggers the error, removing the inner removes the message.
20 ptr: Box<ArefInner<T>>,
22 impl<T: ?Sized + marker::Unsize<U>, U: ?Sized> ops::CoerceUnsized<Aref<U>> for Aref<T> {}
24 struct ArefInner<T: ?Sized>
26 // Even with this field commented out, the error is raised.