about summary refs log tree commit diff
path: root/tests/ui/specialization/issue-111232.rs
blob: fa00f01886fb5764fd9edc536ce8dadbebc0f674 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#![feature(min_specialization)]
#![feature(const_trait_impl)]

trait From<T> {
    fn from(t: T) -> Self;
}

impl<T> From<T> for T {
    fn from(t: T) -> T { t }
}

struct S;

impl From<S> for S {
    fn from(s: S) -> S { //~ ERROR `from` specializes an item from a parent `impl`, but that item is not marked `default`
        s
    }
}

fn main() {}