rust/tests/rustdoc-ui/not-wf-ambiguous-normalization.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
520 B
Rust
Raw Normal View History

2022-10-21 13:53:27 -05:00
// compile-flags: -Znormalize-docs
#![feature(type_alias_impl_trait)]
trait Allocator {
type Buffer;
}
struct DefaultAllocator;
// This unconstrained impl parameter causes the normalization of
// `<DefaultAllocator as Allocator>::Buffer` to be ambiguous,
// which caused an ICE with `-Znormalize-docs`.
impl<T> Allocator for DefaultAllocator {
2023-10-31 08:58:03 -05:00
//~^ ERROR: type annotations needed
2022-10-21 13:53:27 -05:00
type Buffer = ();
}
type A = impl Fn(<DefaultAllocator as Allocator>::Buffer);
fn foo() -> A {
|_| ()
}
fn main() {}