Add a regression test for a fixed new trait solver bug

Not sure what exactly fixed it, but why not.
This commit is contained in:
Chayim Refael Friedman 2025-09-04 12:18:22 +03:00
parent a79e27b8d2
commit aa2bb65417

View File

@ -1,6 +1,6 @@
use expect_test::expect;
use super::check_infer;
use crate::tests::{check_infer, check_no_mismatches};
#[test]
fn opaque_generics() {
@ -50,3 +50,24 @@ fn main() {
"#]],
);
}
#[test]
fn regression_20487() {
check_no_mismatches(
r#"
//- minicore: coerce_unsized, dispatch_from_dyn
trait Foo {
fn bar(&self) -> u32 {
0xCAFE
}
}
fn debug(_: &dyn Foo) {}
impl Foo for i32 {}
fn main() {
debug(&1);
}"#,
);
}