Unnamed repository; edit this file 'description' to name the repository.
| -rw-r--r-- | crates/hir-ty/src/tests/regression/new_solver.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/regression/new_solver.rs b/crates/hir-ty/src/tests/regression/new_solver.rs index 154cddf40f..97f83ca036 100644 --- a/crates/hir-ty/src/tests/regression/new_solver.rs +++ b/crates/hir-ty/src/tests/regression/new_solver.rs @@ -11,6 +11,23 @@ use crate::{ }; #[test] +fn nested_argument_position_impl_trait_captures_lifetime() { + check_no_mismatches( + r#" +//- minicore: iterator +trait Trait<'a> {} + +fn f<'a>(_values: impl IntoIterator<Item = impl Trait<'a>>) {} + +fn crash<'a>(expr: &'a (), values: impl IntoIterator<Item = impl Trait<'a>>) -> &'a () { + f(values); + expr +} +"#, + ); +} + +#[test] fn liberating_distinct_late_bound_lifetimes_preserves_identity() { let (db, file_id) = TestDB::with_single_file( r#" |