diff options
-rw-r--r-- | Cargo.lock | 8 | ||||
-rw-r--r-- | crates/ra_cargo_watch/src/conv/test.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/lower.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/tests/regression.rs | 17 |
4 files changed, 24 insertions, 5 deletions
diff --git a/Cargo.lock b/Cargo.lock index 65120c362..86e0f45a1 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -450,7 +450,7 @@ name = "humantime" | |||
450 | version = "1.3.0" | 450 | version = "1.3.0" |
451 | source = "registry+https://github.com/rust-lang/crates.io-index" | 451 | source = "registry+https://github.com/rust-lang/crates.io-index" |
452 | dependencies = [ | 452 | dependencies = [ |
453 | "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | 453 | "quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", |
454 | ] | 454 | ] |
455 | 455 | ||
456 | [[package]] | 456 | [[package]] |
@@ -844,7 +844,7 @@ dependencies = [ | |||
844 | "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | 844 | "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", |
845 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | 845 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", |
846 | "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", | 846 | "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", |
847 | "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | 847 | "quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", |
848 | "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", | 848 | "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", |
849 | "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | 849 | "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", |
850 | "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | 850 | "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -853,7 +853,7 @@ dependencies = [ | |||
853 | 853 | ||
854 | [[package]] | 854 | [[package]] |
855 | name = "quick-error" | 855 | name = "quick-error" |
856 | version = "1.2.2" | 856 | version = "1.2.3" |
857 | source = "registry+https://github.com/rust-lang/crates.io-index" | 857 | source = "registry+https://github.com/rust-lang/crates.io-index" |
858 | 858 | ||
859 | [[package]] | 859 | [[package]] |
@@ -1889,7 +1889,7 @@ dependencies = [ | |||
1889 | "checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" | 1889 | "checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" |
1890 | "checksum proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0319972dcae462681daf4da1adeeaa066e3ebd29c69be96c6abb1259d2ee2bcc" | 1890 | "checksum proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0319972dcae462681daf4da1adeeaa066e3ebd29c69be96c6abb1259d2ee2bcc" |
1891 | "checksum proptest 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cf147e022eacf0c8a054ab864914a7602618adba841d800a9a9868a5237a529f" | 1891 | "checksum proptest 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cf147e022eacf0c8a054ab864914a7602618adba841d800a9a9868a5237a529f" |
1892 | "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" | 1892 | "checksum quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" |
1893 | "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" | 1893 | "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" |
1894 | "checksum ra_vfs 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bc898f237e4b4498959ae0100c688793a23e77624d44ef710ba70094217f98e0" | 1894 | "checksum ra_vfs 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bc898f237e4b4498959ae0100c688793a23e77624d44ef710ba70094217f98e0" |
1895 | "checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" | 1895 | "checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" |
diff --git a/crates/ra_cargo_watch/src/conv/test.rs b/crates/ra_cargo_watch/src/conv/test.rs index f77ef1b4d..6b86525b8 100644 --- a/crates/ra_cargo_watch/src/conv/test.rs +++ b/crates/ra_cargo_watch/src/conv/test.rs | |||
@@ -1,7 +1,9 @@ | |||
1 | //! This module contains the large and verbose snapshot tests for the | 1 | //! This module contains the large and verbose snapshot tests for the |
2 | //! conversions between `cargo check` json and LSP diagnostics. | 2 | //! conversions between `cargo check` json and LSP diagnostics. |
3 | #[cfg(not(windows))] | ||
3 | use crate::*; | 4 | use crate::*; |
4 | 5 | ||
6 | #[cfg(not(windows))] | ||
5 | fn parse_diagnostic(val: &str) -> cargo_metadata::diagnostic::Diagnostic { | 7 | fn parse_diagnostic(val: &str) -> cargo_metadata::diagnostic::Diagnostic { |
6 | serde_json::from_str::<cargo_metadata::diagnostic::Diagnostic>(val).unwrap() | 8 | serde_json::from_str::<cargo_metadata::diagnostic::Diagnostic>(val).unwrap() |
7 | } | 9 | } |
diff --git a/crates/ra_hir_ty/src/lower.rs b/crates/ra_hir_ty/src/lower.rs index af3db2e1d..2c2ecee9c 100644 --- a/crates/ra_hir_ty/src/lower.rs +++ b/crates/ra_hir_ty/src/lower.rs | |||
@@ -331,7 +331,7 @@ pub(super) fn substs_from_path_segment( | |||
331 | if let Some(generic_args) = &segment.args_and_bindings { | 331 | if let Some(generic_args) = &segment.args_and_bindings { |
332 | // if args are provided, it should be all of them, but we can't rely on that | 332 | // if args are provided, it should be all of them, but we can't rely on that |
333 | let self_param_correction = if add_self_param { 1 } else { 0 }; | 333 | let self_param_correction = if add_self_param { 1 } else { 0 }; |
334 | let child_len = child_len + self_param_correction; | 334 | let child_len = child_len - self_param_correction; |
335 | for arg in generic_args.args.iter().take(child_len) { | 335 | for arg in generic_args.args.iter().take(child_len) { |
336 | match arg { | 336 | match arg { |
337 | GenericArg::Type(type_ref) => { | 337 | GenericArg::Type(type_ref) => { |
diff --git a/crates/ra_hir_ty/src/tests/regression.rs b/crates/ra_hir_ty/src/tests/regression.rs index 8b3aa8564..13c5f62e4 100644 --- a/crates/ra_hir_ty/src/tests/regression.rs +++ b/crates/ra_hir_ty/src/tests/regression.rs | |||
@@ -365,3 +365,20 @@ fn issue_2669() { | |||
365 | "### | 365 | "### |
366 | ) | 366 | ) |
367 | } | 367 | } |
368 | |||
369 | #[test] | ||
370 | fn issue_2705() { | ||
371 | assert_snapshot!( | ||
372 | infer(r#" | ||
373 | trait Trait {} | ||
374 | fn test() { | ||
375 | <Trait<u32>>::foo() | ||
376 | } | ||
377 | "#), | ||
378 | @r###" | ||
379 | [26; 53) '{ ...oo() }': () | ||
380 | [32; 49) '<Trait...>::foo': {unknown} | ||
381 | [32; 51) '<Trait...:foo()': () | ||
382 | "### | ||
383 | ); | ||
384 | } | ||