summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-ui/not-wf-ambiguous-normalization.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rustdoc-ui/not-wf-ambiguous-normalization.rs')
-rw-r--r--tests/rustdoc-ui/not-wf-ambiguous-normalization.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/rustdoc-ui/not-wf-ambiguous-normalization.rs b/tests/rustdoc-ui/not-wf-ambiguous-normalization.rs
new file mode 100644
index 000000000..3e4825d83
--- /dev/null
+++ b/tests/rustdoc-ui/not-wf-ambiguous-normalization.rs
@@ -0,0 +1,25 @@
+// 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 {
+ //~^ ERROR: type annotations needed
+ type Buffer = ();
+}
+
+type A = impl Fn(<DefaultAllocator as Allocator>::Buffer);
+
+fn foo() -> A {
+ |_| ()
+}
+
+fn main() {}