summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-36381.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/issues/issue-36381.rs')
-rw-r--r--src/test/ui/issues/issue-36381.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-36381.rs b/src/test/ui/issues/issue-36381.rs
new file mode 100644
index 000000000..7db56f1dc
--- /dev/null
+++ b/src/test/ui/issues/issue-36381.rs
@@ -0,0 +1,25 @@
+// run-pass
+// Regression test for #36381. The monomorphization collector was asserting that
+// there are no projection types, but the `<&str as
+// StreamOnce>::Position` projection contained a late-bound region,
+// and we don't currently normalize in that case until the function is
+// actually invoked.
+
+pub trait StreamOnce {
+ type Position;
+}
+
+impl<'a> StreamOnce for &'a str {
+ type Position = usize;
+}
+
+pub fn parser<F>(_: F) {
+}
+
+fn follow(_: &str) -> <&str as StreamOnce>::Position {
+ panic!()
+}
+
+fn main() {
+ parser(follow);
+}