about summary refs log tree commit diff
path: root/tests/ui/sized-hierarchy/pretty-print-opaque-no-feat.rs
blob: 955108a20744ba69166c230d970bac98dd8e2e13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//@ compile-flags: --crate-type=lib

pub trait Tr {}
impl Tr for u32 {}

pub fn foo() -> Box<impl Tr + ?Sized> {
    if true {
        let x = foo();
        let y: Box<dyn Tr> = x;
//~^ ERROR: the size for values of type `impl Tr + ?Sized` cannot be known
    }
    Box::new(1u32)
}