]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/not-wf-ambiguous-normalization.rs
Fix problem noticed in PR106859 with char -> u8 suggestion
[rust.git] / tests / rustdoc / not-wf-ambiguous-normalization.rs
1 // compile-flags: -Znormalize-docs
2
3 #![feature(type_alias_impl_trait)]
4
5 trait Allocator {
6     type Buffer;
7 }
8
9 struct DefaultAllocator;
10
11 // This unconstrained impl parameter causes the normalization of
12 // `<DefaultAllocator as Allocator>::Buffer` to be ambiguous,
13 // which caused an ICE with `-Znormalize-docs`.
14 impl<T> Allocator for DefaultAllocator {
15     type Buffer = ();
16 }
17
18 type A = impl Fn(<DefaultAllocator as Allocator>::Buffer);
19
20 fn foo() -> A {
21     |_| ()
22 }
23
24 fn main() {}