Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/regression.rs')
-rw-r--r--crates/hir-ty/src/tests/regression.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/regression.rs b/crates/hir-ty/src/tests/regression.rs
index 2ef8999817..dcb79f042b 100644
--- a/crates/hir-ty/src/tests/regression.rs
+++ b/crates/hir-ty/src/tests/regression.rs
@@ -2947,3 +2947,39 @@ fn caller() {
"#,
);
}
+
+#[test]
+fn regression_22772() {
+ check_no_mismatches(
+ r#"
+trait Resolve {
+ type Prev;
+}
+
+fn migrations_preserve_index() {
+ pub struct RefExpr1<'x> {
+ pub foo: &'x schema::v0::_Ref0,
+ }
+
+ pub fn new_column<'x, C>() -> &'x C {
+ loop {}
+ }
+
+ RefExpr1 { foo: new_column::<schema::Foo>() };
+
+ mod schema {
+ pub struct Foo {}
+ pub struct FooNew {}
+
+ impl crate::Resolve for FooNew {
+ type Prev = Foo;
+ }
+
+ pub mod v0 {
+ pub type _Ref0 = <super::FooNew as crate::Resolve>::Prev;
+ }
+ }
+}
+ "#,
+ );
+}