This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +43
-12
lines changed
crates/ide-diagnostics/src/handlers Expand file tree Collapse file tree 3 files changed +43
-12
lines changed Original file line number Diff line number Diff line change @@ -194,9 +194,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
194194
195195[[package ]]
196196name = " chalk-derive"
197- version = " 0.98 .0"
197+ version = " 0.99 .0"
198198source = " registry+https://github.com/rust-lang/crates.io-index"
199- checksum = " 9426c8fd0fe61c3da880b801d3b510524df17843a8f9ec1f5b9cec24fb7412df "
199+ checksum = " 572583d9b97f9d277e5c7607f8239a30e2e04d3ed3b47c87d1cb2152ae724073 "
200200dependencies = [
201201 " proc-macro2" ,
202202 " quote" ,
@@ -206,19 +206,19 @@ dependencies = [
206206
207207[[package ]]
208208name = " chalk-ir"
209- version = " 0.98 .0"
209+ version = " 0.99 .0"
210210source = " registry+https://github.com/rust-lang/crates.io-index"
211- checksum = " d5f2eb1cd6054da221bd1ac0197fb2fe5e2caf3dcb93619398fc1433f8f09093 "
211+ checksum = " e60e0ef9c81dce1336a9ed3c76f08775f5b623151d96d85ba45f7b10de76d1c7 "
212212dependencies = [
213213 " bitflags 2.7.0" ,
214214 " chalk-derive" ,
215215]
216216
217217[[package ]]
218218name = " chalk-recursive"
219- version = " 0.98 .0"
219+ version = " 0.99 .0"
220220source = " registry+https://github.com/rust-lang/crates.io-index"
221- checksum = " 129dc03458f71cfb9c3cd621c9c68166a94e87b85b16ccd29af015d7ff9a1c61 "
221+ checksum = " 5a06350d614e22b03a69b8105e3541614450a7ea48bc58ecc6c6bd92731a3995 "
222222dependencies = [
223223 " chalk-derive" ,
224224 " chalk-ir" ,
@@ -229,9 +229,9 @@ dependencies = [
229229
230230[[package ]]
231231name = " chalk-solve"
232- version = " 0.98 .0"
232+ version = " 0.99 .0"
233233source = " registry+https://github.com/rust-lang/crates.io-index"
234- checksum = " d7e8a8c1e928f98cdf227b868416ef21dcd8cc3c61b347576d783713444d41c8 "
234+ checksum = " 0e428761e9b55bee516bfe2457caed8b6d1b86353f92ae825bbe438a36ce91e8 "
235235dependencies = [
236236 " chalk-derive" ,
237237 " chalk-ir" ,
Original file line number Diff line number Diff line change @@ -106,10 +106,10 @@ arrayvec = "0.7.4"
106106bitflags = " 2.4.1"
107107cargo_metadata = " 0.18.1"
108108camino = " 1.1.6"
109- chalk-solve = { version = " 0.98 .0" , default-features = false }
110- chalk-ir = " 0.98 .0"
111- chalk-recursive = { version = " 0.98 .0" , default-features = false }
112- chalk-derive = " 0.98 .0"
109+ chalk-solve = { version = " 0.99 .0" , default-features = false }
110+ chalk-ir = " 0.99 .0"
111+ chalk-recursive = { version = " 0.99 .0" , default-features = false }
112+ chalk-derive = " 0.99 .0"
113113crossbeam-channel = " 0.5.8"
114114dissimilar = " 1.0.7"
115115dot = " 0.1.4"
Original file line number Diff line number Diff line change @@ -1163,6 +1163,37 @@ struct Bar {
11631163 ) ;
11641164 }
11651165
1166+ #[ test]
1167+ fn trait_upcast_ok ( ) {
1168+ check_diagnostics (
1169+ r#"
1170+ //- minicore: coerce_unsized
1171+ trait A: B {}
1172+ trait B {}
1173+
1174+ fn test(a: &dyn A) -> &dyn B {
1175+ a
1176+ }
1177+ "# ,
1178+ ) ;
1179+ }
1180+
1181+ #[ test]
1182+ fn trait_upcast_err ( ) {
1183+ check_diagnostics (
1184+ r#"
1185+ //- minicore: coerce_unsized
1186+ trait A {} // `A` does not have `B` as a supertrait, so no upcast :c
1187+ trait B {}
1188+
1189+ fn test(a: &dyn A) -> &dyn B {
1190+ a
1191+ //^ error: expected &dyn B, found &dyn A
1192+ }
1193+ "# ,
1194+ ) ;
1195+ }
1196+
11661197 #[ test]
11671198 fn return_no_value ( ) {
11681199 check_diagnostics_with_disabled (
You can’t perform that action at this time.
0 commit comments