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.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/regression.rs b/crates/hir-ty/src/tests/regression.rs
index 1939db0ef5..e4fc7e56c6 100644
--- a/crates/hir-ty/src/tests/regression.rs
+++ b/crates/hir-ty/src/tests/regression.rs
@@ -2754,6 +2754,7 @@ where
664..680 'filter...ter_fn': dyn Fn(&'? T) -> bool + 'static
691..698 'loop {}': !
696..698 '{}': ()
+ 512..513 'N': usize
"#]],
);
}
@@ -2815,3 +2816,28 @@ fn contains_0<S: Collection<Item = i32>>(points: &S) {
"#,
);
}
+
+#[test]
+fn regression_21773() {
+ check_no_mismatches(
+ r#"
+trait Neg {
+ type Output;
+}
+
+trait Abs: Neg {
+ fn abs(&self) -> Self::Output;
+}
+
+trait SelfAbs: Abs + Neg
+where
+ Self::Output: Neg<Output = Self::Output> + Abs,
+{
+}
+
+fn wrapped_abs<T: SelfAbs<Output = T>>(v: T) -> T {
+ v.abs()
+}
+ "#,
+ );
+}