diff options
| author | Chayim Refael Friedman <chayimfr@gmail.com> | 2025-09-04 12:18:22 +0300 |
|---|---|---|
| committer | Chayim Refael Friedman <chayimfr@gmail.com> | 2025-09-04 12:18:22 +0300 |
| commit | d5cb7e7c7c0f77c7a7b064584ae44e74acc155ca (patch) | |
| tree | 83aaf4b8071e3d01431924bc8406a5a672e1bc8c | |
| parent | 2127c2df5d669bbed19f7a184ad90c8e2cb671d3 (diff) | |
| download | rust-d5cb7e7c7c0f77c7a7b064584ae44e74acc155ca.tar.gz rust-d5cb7e7c7c0f77c7a7b064584ae44e74acc155ca.zip | |
Add a regression test for a fixed new trait solver bug
Not sure what exactly fixed it, but why not.
| -rw-r--r-- | src/tools/rust-analyzer/crates/hir-ty/src/tests/regression/new_solver.rs | 23 |
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); +}"#, + ); +} |
