1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 // Regression test for #41936. The coerce-unsized trait check in
14 // coherence was using subtyping, which triggered variance
15 // computation, which failed because it required type info for fields
16 // that had not (yet) been computed.
19 #![feature(coerce_unsized)]
21 use std::{marker,ops};
23 // Change the array to a non-array, and error disappears
24 // Adding a new field to the end keeps the error
25 struct LogDataBuf([u8;8]);
27 struct Aref<T: ?Sized>
29 // Inner structure triggers the error, removing the inner removes the message.
30 ptr: Box<ArefInner<T>>,
32 impl<T: ?Sized + marker::Unsize<U>, U: ?Sized> ops::CoerceUnsized<Aref<U>> for Aref<T> {}
34 struct ArefInner<T: ?Sized>
36 // Even with this field commented out, the error is raised.