diff options
| author | Chayim Refael Friedman <chayimfr@gmail.com> | 2025-09-22 10:26:03 +0300 |
|---|---|---|
| committer | Chayim Refael Friedman <chayimfr@gmail.com> | 2025-09-22 10:26:03 +0300 |
| commit | 4193716963035cccc26dfde9dbf6a78a133dfb60 (patch) | |
| tree | c40dc49556a84eb0a877ffffda38d3d815b193c7 | |
| parent | 45dda35957ed322c3bccd094dcfa9b925336cc8d (diff) | |
| download | rust-4193716963035cccc26dfde9dbf6a78a133dfb60.tar.gz rust-4193716963035cccc26dfde9dbf6a78a133dfb60.zip | |
Another regression test for next solver fixed bug
| -rw-r--r-- | src/tools/rust-analyzer/crates/hir-ty/src/tests/regression/new_solver.rs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/tests/regression/new_solver.rs b/src/tools/rust-analyzer/crates/hir-ty/src/tests/regression/new_solver.rs index ead79a8f5b9..c7711f31bf2 100644 --- a/src/tools/rust-analyzer/crates/hir-ty/src/tests/regression/new_solver.rs +++ b/src/tools/rust-analyzer/crates/hir-ty/src/tests/regression/new_solver.rs @@ -418,3 +418,35 @@ fn foo() { "#]], ); } + +#[test] +fn regression_19637() { + check_no_mismatches( + r#" +//- minicore: coerce_unsized +pub trait Any {} + +impl<T: 'static> Any for T {} + +pub trait Trait: Any { + type F; +} + +pub struct TT {} + +impl Trait for TT { + type F = f32; +} + +pub fn coercion(x: &mut dyn Any) -> &mut dyn Any { + x +} + +fn main() { + let mut t = TT {}; + let tt = &mut t as &mut dyn Trait<F = f32>; + let st = coercion(tt); +} + "#, + ); +} |
