rust/tests/ui/dropck/dropck-only-error-ambiguity.rs
Matthew Jasper 87e5969572 Update tests for dropck normalization errors
Takes crash tests from #135039, #103899, #91985 and #105299 and turns them into ui tests
2025-02-17 11:33:07 +00:00

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() {}