about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
diff options
context:
space:
mode:
authorChayim Refael Friedman <chayimfr@gmail.com>2025-09-04 09:34:45 +0000
committerGitHub <noreply@github.com>2025-09-04 09:34:45 +0000
commita5872e98f8dda9fd2757a0740fcc3797263ee82d (patch)
treea40736ab9a6ddb3238e70ceea716d427681f8c2d /src/tools/rust-analyzer
parentdfc0433aab0044975db26177c3e8ad01b35cdad8 (diff)
parentd5cb7e7c7c0f77c7a7b064584ae44e74acc155ca (diff)
downloadrust-a5872e98f8dda9fd2757a0740fcc3797263ee82d.tar.gz
rust-a5872e98f8dda9fd2757a0740fcc3797263ee82d.zip
Merge pull request #20607 from ChayimFriedman2/ns-dyn-mismatch
internal: Add a regression test for a fixed new trait solver bug
Diffstat (limited to 'src/tools/rust-analyzer')
-rw-r--r--src/tools/rust-analyzer/crates/hir-ty/src/tests/regression/new_solver.rs23
1 files changed, 22 insertions, 1 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 20190fbc045..e4ee52f45eb 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
@@ -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);
+}"#,
+    );
+}