From 48ae948b222a58ad784d7881cbc7a8556dc82711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Sun, 21 Feb 2021 19:11:49 +0200 Subject: Bump deps --- crates/hir_ty/Cargo.toml | 6 +++--- crates/syntax/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crates') 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" log = "0.4.8" rustc-hash = "1.1.0" scoped-tls = "1" -chalk-solve = { version = "0.56", default-features = false } -chalk-ir = "0.56" -chalk-recursive = "0.56" +chalk-solve = { version = "0.58", default-features = false } +chalk-ir = "0.58" +chalk-recursive = "0.58" la-arena = { version = "0.2.0", path = "../../lib/arena" } stdx = { path = "../stdx", version = "0.0.0" } 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 [dependencies] itertools = "0.10.0" rowan = "0.12.2" -rustc_lexer = { version = "705.0.0", package = "rustc-ap-rustc_lexer" } +rustc_lexer = { version = "707.0.0", package = "rustc-ap-rustc_lexer" } rustc-hash = "1.1.0" arrayvec = "0.5.1" once_cell = "1.3.1" -- cgit v1.2.3 From d03cfe141c9602f64fc2a194d77ac9386d0ddcf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Sun, 21 Feb 2021 19:17:06 +0200 Subject: Add test from #7273 --- crates/hir_ty/src/tests/method_resolution.rs | 45 ++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'crates') 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 @@ -955,6 +955,51 @@ fn test() { foo.call(); } ); } +#[test] +fn super_trait_impl_return_trait_method_resolution() { + check_infer( + r#" + trait Base { + fn foo(self) -> usize; + } + + trait Super : Base {} + + fn base1() -> impl Base { loop {} } + fn super1() -> impl Super { loop {} } + + fn test(base2: impl Base, super2: impl Super) { + base1().foo(); + super1().foo(); + base2.foo(); + super2.foo(); + } + "#, + expect![[r#" + 24..28 'self': Self + 90..101 '{ loop {} }': ! + 92..99 'loop {}': ! + 97..99 '{}': () + 128..139 '{ loop {} }': ! + 130..137 'loop {}': ! + 135..137 '{}': () + 149..154 'base2': impl Base + 167..173 'super2': impl Super + 187..264 '{ ...o(); }': () + 193..198 'base1': fn base1() -> impl Base + 193..200 'base1()': impl Base + 193..206 'base1().foo()': usize + 212..218 'super1': fn super1() -> impl Super + 212..220 'super1()': impl Super + 212..226 'super1().foo()': usize + 232..237 'base2': impl Base + 232..243 'base2.foo()': usize + 249..255 'super2': impl Super + 249..261 'super2.foo()': usize + "#]], + ); +} + #[test] fn method_resolution_non_parameter_type() { check_types( -- cgit v1.2.3