Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/closure_captures.rs')
-rw-r--r--crates/hir-ty/src/tests/closure_captures.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/closure_captures.rs b/crates/hir-ty/src/tests/closure_captures.rs
index 3bdc72d015..8408c0a7bf 100644
--- a/crates/hir-ty/src/tests/closure_captures.rs
+++ b/crates/hir-ty/src/tests/closure_captures.rs
@@ -503,3 +503,28 @@ fn main() {
expect!["73..149;37..38;103..104 ByValue b Option<Box>"],
);
}
+
+#[test]
+fn alias_needs_to_be_normalized() {
+ check_closure_captures(
+ r#"
+//- minicore:copy
+trait Trait {
+ type Associated;
+}
+struct A;
+struct B { x: i32 }
+impl Trait for A {
+ type Associated = B;
+}
+struct C { b: <A as Trait>::Associated }
+fn main() {
+ let c: C = C { b: B { x: 1 } };
+ let closure = || {
+ let _move = c.b.x;
+ };
+}
+"#,
+ expect!["220..257;174..175;245..250 ByRef(Shared) c.b.x &'? i32"],
+ );
+}