Merge pull request #20607 from ChayimFriedman2/ns-dyn-mismatch

internal: Add a regression test for a fixed new trait solver bug
This commit is contained in:
Chayim Refael Friedman 2025-09-04 09:34:45 +00:00 committed by GitHub
commit a5872e98f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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);
}"#,
);
}