mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
24 lines
541 B
Rust
24 lines
541 B
Rust
// 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() {}
|