about summary refs log tree commit diff
path: root/tests/ui/dropck/dropck-only-error-ambiguity.rs
blob: ddba2af7070325458c0ceefb080f6e30ba609801 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Test that we don't ICE for a typeck error that only shows up in dropck
// Version where the normalization error is an ambiguous trait implementation.
// <[T] as ToOwned>::Owned is ambiguous on whether to use T: Clone or [T]::Clone.
// Regression test for #105299

pub trait Foo: Clone {}

pub struct Bar<'a, T: Clone> {
    pub cow: std::borrow::Cow<'a, [T]>,

    pub THIS_CAUSES_ICE: (),
}

impl<T> Bar<'_, T>
where
    T: Clone,
    [T]: Foo,
{
    pub fn MOVES_SELF(self) {}
    //~^ ERROR type annotations needed
}

pub fn main() {}