about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-11-07 18:35:25 +0530
committerGitHub <noreply@github.com>2022-11-07 18:35:25 +0530
commitf0bd2cdde4b6e48d894fdc59aec6dc445a3506b2 (patch)
tree139571bcd466e07b7f03e5ac0684f823ff6f413d /src
parentc5903969145660350d2e7c7e4757c83949beccb7 (diff)
parent9a1043eac7dbd7177ce032c0f777b5ee2f636621 (diff)
downloadrust-f0bd2cdde4b6e48d894fdc59aec6dc445a3506b2.tar.gz
rust-f0bd2cdde4b6e48d894fdc59aec6dc445a3506b2.zip
Rollup merge of #104038 - compiler-errors:super-norm-closure-sig, r=lcnr
Normalize types when deducing closure signature from supertraits

Elaborated supertraits should be normalized, since there's no guarantee they don't contain projections :sweat_smile:

Fixes #104025
r? types
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/closures/supertrait-hint-references-assoc-ty.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/closures/supertrait-hint-references-assoc-ty.rs b/src/test/ui/closures/supertrait-hint-references-assoc-ty.rs
new file mode 100644
index 00000000000..270bf14c35e
--- /dev/null
+++ b/src/test/ui/closures/supertrait-hint-references-assoc-ty.rs
@@ -0,0 +1,17 @@
+// check-pass
+
+pub trait Fn0: Fn(i32) -> Self::Out {
+    type Out;
+}
+
+impl<F: Fn(i32) -> ()> Fn0 for F {
+    type Out = ();
+}
+
+pub fn closure_typer(_: impl Fn0) {}
+
+fn main() {
+    closure_typer(move |x| {
+        let _: i64 = x.into();
+    });
+}