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.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/regression.rs b/crates/hir-ty/src/tests/regression.rs index 1939db0ef5..d88801a57b 100644 --- a/crates/hir-ty/src/tests/regression.rs +++ b/crates/hir-ty/src/tests/regression.rs @@ -2815,3 +2815,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() +} + "#, + ); +} |