aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock73
-rw-r--r--crates/hir_ty/Cargo.toml6
-rw-r--r--crates/hir_ty/src/tests/method_resolution.rs45
-rw-r--r--crates/syntax/Cargo.toml2
-rw-r--r--xtask/Cargo.toml2
5 files changed, 100 insertions, 28 deletions
diff --git a/Cargo.lock b/Cargo.lock
index e8d9020d6..2a8ef7ef3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,5 +1,7 @@
1# This file is automatically @generated by Cargo. 1# This file is automatically @generated by Cargo.
2# It is not intended for manual editing. 2# It is not intended for manual editing.
3version = 3
4
3[[package]] 5[[package]]
4name = "addr2line" 6name = "addr2line"
5version = "0.14.1" 7version = "0.14.1"
@@ -172,9 +174,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
172 174
173[[package]] 175[[package]]
174name = "chalk-derive" 176name = "chalk-derive"
175version = "0.56.0" 177version = "0.58.0"
176source = "registry+https://github.com/rust-lang/crates.io-index" 178source = "registry+https://github.com/rust-lang/crates.io-index"
177checksum = "51f6c7a4b1a119cff6c5a17cf68056069dece7bc525c2a2e26e1117e27f48ca2" 179checksum = "e625b7c688272783140509a0de8f7aa9000217cb0982c9b10606a12b0b747ba8"
178dependencies = [ 180dependencies = [
179 "proc-macro2", 181 "proc-macro2",
180 "quote", 182 "quote",
@@ -184,9 +186,9 @@ dependencies = [
184 186
185[[package]] 187[[package]]
186name = "chalk-ir" 188name = "chalk-ir"
187version = "0.56.0" 189version = "0.58.0"
188source = "registry+https://github.com/rust-lang/crates.io-index" 190source = "registry+https://github.com/rust-lang/crates.io-index"
189checksum = "7d5f524bc3a5798fe3711c360fde350bffb938b52ef7b302d637550229995e20" 191checksum = "c220d870128959d7d56667060d556ffdebd490f32ee0fc9f4060a76c1193f206"
190dependencies = [ 192dependencies = [
191 "bitflags", 193 "bitflags",
192 "chalk-derive", 194 "chalk-derive",
@@ -195,9 +197,9 @@ dependencies = [
195 197
196[[package]] 198[[package]]
197name = "chalk-recursive" 199name = "chalk-recursive"
198version = "0.56.0" 200version = "0.58.0"
199source = "registry+https://github.com/rust-lang/crates.io-index" 201source = "registry+https://github.com/rust-lang/crates.io-index"
200checksum = "f7c0525fb9c43f8f1d7ba4fb42f9ada2a2415901a04b5c655cfe11e559085d4d" 202checksum = "7d8cd81a15aa936215378e695a8907b9f1af8626a27a32ee22e97a50984960da"
201dependencies = [ 203dependencies = [
202 "chalk-derive", 204 "chalk-derive",
203 "chalk-ir", 205 "chalk-ir",
@@ -208,9 +210,9 @@ dependencies = [
208 210
209[[package]] 211[[package]]
210name = "chalk-solve" 212name = "chalk-solve"
211version = "0.56.0" 213version = "0.58.0"
212source = "registry+https://github.com/rust-lang/crates.io-index" 214source = "registry+https://github.com/rust-lang/crates.io-index"
213checksum = "3c2e7b54add0f18d5ee7bb043a3108b819e60b1b409d214291bcdc97927cdc32" 215checksum = "55571250dfe096a4c899be88c81418284c952ce1c8a06aa16afb5781b298e9c9"
214dependencies = [ 216dependencies = [
215 "chalk-derive", 217 "chalk-derive",
216 "chalk-ir", 218 "chalk-ir",
@@ -246,12 +248,6 @@ dependencies = [
246] 248]
247 249
248[[package]] 250[[package]]
249name = "const_fn"
250version = "0.4.5"
251source = "registry+https://github.com/rust-lang/crates.io-index"
252checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6"
253
254[[package]]
255name = "countme" 251name = "countme"
256version = "2.0.4" 252version = "2.0.4"
257source = "registry+https://github.com/rust-lang/crates.io-index" 253source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -294,27 +290,28 @@ dependencies = [
294 290
295[[package]] 291[[package]]
296name = "crossbeam-epoch" 292name = "crossbeam-epoch"
297version = "0.9.1" 293version = "0.9.2"
298source = "registry+https://github.com/rust-lang/crates.io-index" 294source = "registry+https://github.com/rust-lang/crates.io-index"
299checksum = "a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d" 295checksum = "d60ab4a8dba064f2fbb5aa270c28da5cf4bbd0e72dae1140a6b0353a779dbe00"
300dependencies = [ 296dependencies = [
301 "cfg-if", 297 "cfg-if",
302 "const_fn",
303 "crossbeam-utils", 298 "crossbeam-utils",
304 "lazy_static", 299 "lazy_static",
300 "loom",
305 "memoffset", 301 "memoffset",
306 "scopeguard", 302 "scopeguard",
307] 303]
308 304
309[[package]] 305[[package]]
310name = "crossbeam-utils" 306name = "crossbeam-utils"
311version = "0.8.1" 307version = "0.8.2"
312source = "registry+https://github.com/rust-lang/crates.io-index" 308source = "registry+https://github.com/rust-lang/crates.io-index"
313checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" 309checksum = "bae8f328835f8f5a6ceb6a7842a7f2d0c03692adb5c889347235d59194731fe3"
314dependencies = [ 310dependencies = [
315 "autocfg", 311 "autocfg",
316 "cfg-if", 312 "cfg-if",
317 "lazy_static", 313 "lazy_static",
314 "loom",
318] 315]
319 316
320[[package]] 317[[package]]
@@ -458,6 +455,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
458checksum = "d79238883cf0307100b90aba4a755d8051a3182305dfe7f649a1e9dc0517006f" 455checksum = "d79238883cf0307100b90aba4a755d8051a3182305dfe7f649a1e9dc0517006f"
459 456
460[[package]] 457[[package]]
458name = "generator"
459version = "0.6.24"
460source = "registry+https://github.com/rust-lang/crates.io-index"
461checksum = "a9fed24fd1e18827652b4d55652899a1e9da8e54d91624dc3437a5bc3a9f9a9c"
462dependencies = [
463 "cc",
464 "libc",
465 "log",
466 "rustversion",
467 "winapi",
468]
469
470[[package]]
461name = "gimli" 471name = "gimli"
462version = "0.23.0" 472version = "0.23.0"
463source = "registry+https://github.com/rust-lang/crates.io-index" 473source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -821,6 +831,17 @@ dependencies = [
821] 831]
822 832
823[[package]] 833[[package]]
834name = "loom"
835version = "0.4.0"
836source = "registry+https://github.com/rust-lang/crates.io-index"
837checksum = "d44c73b4636e497b4917eb21c33539efa3816741a2d3ff26c6316f1b529481a4"
838dependencies = [
839 "cfg-if",
840 "generator",
841 "scoped-tls",
842]
843
844[[package]]
824name = "lsp-server" 845name = "lsp-server"
825version = "0.5.0" 846version = "0.5.0"
826source = "registry+https://github.com/rust-lang/crates.io-index" 847source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1299,9 +1320,9 @@ checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581"
1299 1320
1300[[package]] 1321[[package]]
1301name = "rowan" 1322name = "rowan"
1302version = "0.12.5" 1323version = "0.12.6"
1303source = "registry+https://github.com/rust-lang/crates.io-index" 1324source = "registry+https://github.com/rust-lang/crates.io-index"
1304checksum = "e29b035c9f476b43074a36257464c487788a0a1b9aaf427b068dc147135eb1ab" 1325checksum = "a1b36e449f3702f3b0c821411db1cbdf30fb451726a9456dce5dabcd44420043"
1305dependencies = [ 1326dependencies = [
1306 "countme", 1327 "countme",
1307 "hashbrown", 1328 "hashbrown",
@@ -1364,9 +1385,9 @@ dependencies = [
1364 1385
1365[[package]] 1386[[package]]
1366name = "rustc-ap-rustc_lexer" 1387name = "rustc-ap-rustc_lexer"
1367version = "705.0.0" 1388version = "707.0.0"
1368source = "registry+https://github.com/rust-lang/crates.io-index" 1389source = "registry+https://github.com/rust-lang/crates.io-index"
1369checksum = "3a030d00510966cd31e13dca5e6c1bd40d303a932c54eca40e854188bca8c49e" 1390checksum = "e27206aceb3b2153a3c367727d534362a1ce63a43ece8fd878195738a83aaf6f"
1370dependencies = [ 1391dependencies = [
1371 "unicode-xid", 1392 "unicode-xid",
1372] 1393]
@@ -1384,6 +1405,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1384checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 1405checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
1385 1406
1386[[package]] 1407[[package]]
1408name = "rustversion"
1409version = "1.0.4"
1410source = "registry+https://github.com/rust-lang/crates.io-index"
1411checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd"
1412
1413[[package]]
1387name = "ryu" 1414name = "ryu"
1388version = "1.0.5" 1415version = "1.0.5"
1389source = "registry+https://github.com/rust-lang/crates.io-index" 1416source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/crates/hir_ty/Cargo.toml b/crates/hir_ty/Cargo.toml
index 418ac8cbb..6ef9d1e7e 100644
--- a/crates/hir_ty/Cargo.toml
+++ b/crates/hir_ty/Cargo.toml
@@ -17,9 +17,9 @@ ena = "0.14.0"
17log = "0.4.8" 17log = "0.4.8"
18rustc-hash = "1.1.0" 18rustc-hash = "1.1.0"
19scoped-tls = "1" 19scoped-tls = "1"
20chalk-solve = { version = "0.56", default-features = false } 20chalk-solve = { version = "0.58", default-features = false }
21chalk-ir = "0.56" 21chalk-ir = "0.58"
22chalk-recursive = "0.56" 22chalk-recursive = "0.58"
23la-arena = { version = "0.2.0", path = "../../lib/arena" } 23la-arena = { version = "0.2.0", path = "../../lib/arena" }
24 24
25stdx = { path = "../stdx", version = "0.0.0" } 25stdx = { path = "../stdx", version = "0.0.0" }
diff --git a/crates/hir_ty/src/tests/method_resolution.rs b/crates/hir_ty/src/tests/method_resolution.rs
index 659b8fce9..a9901d7b8 100644
--- a/crates/hir_ty/src/tests/method_resolution.rs
+++ b/crates/hir_ty/src/tests/method_resolution.rs
@@ -956,6 +956,51 @@ fn test() { foo.call(); }
956} 956}
957 957
958#[test] 958#[test]
959fn super_trait_impl_return_trait_method_resolution() {
960 check_infer(
961 r#"
962 trait Base {
963 fn foo(self) -> usize;
964 }
965
966 trait Super : Base {}
967
968 fn base1() -> impl Base { loop {} }
969 fn super1() -> impl Super { loop {} }
970
971 fn test(base2: impl Base, super2: impl Super) {
972 base1().foo();
973 super1().foo();
974 base2.foo();
975 super2.foo();
976 }
977 "#,
978 expect![[r#"
979 24..28 'self': Self
980 90..101 '{ loop {} }': !
981 92..99 'loop {}': !
982 97..99 '{}': ()
983 128..139 '{ loop {} }': !
984 130..137 'loop {}': !
985 135..137 '{}': ()
986 149..154 'base2': impl Base
987 167..173 'super2': impl Super
988 187..264 '{ ...o(); }': ()
989 193..198 'base1': fn base1() -> impl Base
990 193..200 'base1()': impl Base
991 193..206 'base1().foo()': usize
992 212..218 'super1': fn super1() -> impl Super
993 212..220 'super1()': impl Super
994 212..226 'super1().foo()': usize
995 232..237 'base2': impl Base
996 232..243 'base2.foo()': usize
997 249..255 'super2': impl Super
998 249..261 'super2.foo()': usize
999 "#]],
1000 );
1001}
1002
1003#[test]
959fn method_resolution_non_parameter_type() { 1004fn method_resolution_non_parameter_type() {
960 check_types( 1005 check_types(
961 r#" 1006 r#"
diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml
index e3ef71650..e41171b57 100644
--- a/crates/syntax/Cargo.toml
+++ b/crates/syntax/Cargo.toml
@@ -13,7 +13,7 @@ doctest = false
13[dependencies] 13[dependencies]
14itertools = "0.10.0" 14itertools = "0.10.0"
15rowan = "0.12.2" 15rowan = "0.12.2"
16rustc_lexer = { version = "705.0.0", package = "rustc-ap-rustc_lexer" } 16rustc_lexer = { version = "707.0.0", package = "rustc-ap-rustc_lexer" }
17rustc-hash = "1.1.0" 17rustc-hash = "1.1.0"
18arrayvec = "0.5.1" 18arrayvec = "0.5.1"
19once_cell = "1.3.1" 19once_cell = "1.3.1"
diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml
index 4e6b439fd..b379797f9 100644
--- a/xtask/Cargo.toml
+++ b/xtask/Cargo.toml
@@ -15,7 +15,7 @@ flate2 = "1.0"
15pico-args = "0.4.0" 15pico-args = "0.4.0"
16proc-macro2 = "1.0.8" 16proc-macro2 = "1.0.8"
17quote = "1.0.2" 17quote = "1.0.2"
18ungrammar = "1.9" 18ungrammar = "=1.11"
19walkdir = "2.3.1" 19walkdir = "2.3.1"
20write-json = "0.1.0" 20write-json = "0.1.0"
21xshell = "0.1" 21xshell = "0.1"