Skip to content

Commit d5f597e

Browse files
Another regression test for next solver fixed bug
1 parent e7d7cb4 commit d5f597e

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

crates/hir-ty/src/tests/regression/new_solver.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,3 +418,35 @@ fn foo() {
418418
"#]],
419419
);
420420
}
421+
422+
#[test]
423+
fn regression_19637() {
424+
check_no_mismatches(
425+
r#"
426+
//- minicore: coerce_unsized
427+
pub trait Any {}
428+
429+
impl<T: 'static> Any for T {}
430+
431+
pub trait Trait: Any {
432+
type F;
433+
}
434+
435+
pub struct TT {}
436+
437+
impl Trait for TT {
438+
type F = f32;
439+
}
440+
441+
pub fn coercion(x: &mut dyn Any) -> &mut dyn Any {
442+
x
443+
}
444+
445+
fn main() {
446+
let mut t = TT {};
447+
let tt = &mut t as &mut dyn Trait<F = f32>;
448+
let st = coercion(tt);
449+
}
450+
"#,
451+
);
452+
}

0 commit comments

Comments
 (0)