Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/traits.rs')
| -rw-r--r-- | crates/hir-ty/src/tests/traits.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/traits.rs b/crates/hir-ty/src/tests/traits.rs index e67c27aa2d..21a8631976 100644 --- a/crates/hir-ty/src/tests/traits.rs +++ b/crates/hir-ty/src/tests/traits.rs @@ -3901,6 +3901,34 @@ fn g(t: &(dyn Sync + T<Proj = ()> + Send)) { } #[test] +fn dyn_multiple_projection_bounds() { + check_no_mismatches( + r#" +trait Trait { + type T; + type U; +} + +fn f(t: &dyn Trait<T = (), U = ()>) {} +fn g(t: &dyn Trait<U = (), T = ()>) { + f(t); +} + "#, + ); + + check_types( + r#" +trait Trait { + type T; +} + +fn f(t: &dyn Trait<T = (), T = ()>) {} + //^&{unknown} + "#, + ); +} + +#[test] fn dyn_duplicate_auto_trait() { check_no_mismatches( r#" |