diff options
author | Florian Diebold <[email protected]> | 2019-03-23 17:03:09 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-03-23 17:03:09 +0000 |
commit | dbfc68cea05c82d5bd7f8ee4f1cec4b173517eb4 (patch) | |
tree | 0a7386866a6bc0b1f3dc4d3653e683edeeca940f /crates/ra_hir/src/ty/tests.rs | |
parent | 5a6a3d077734d12fe5c7de2af64572611b23b79b (diff) |
Fix apply_substs assertion failure
Fixes #1030.
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 0f2172ddf..5d8ad4aa7 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -1792,6 +1792,29 @@ fn test<R>(query_response: Canonical<QueryResponse<R>>) { | |||
1792 | } | 1792 | } |
1793 | 1793 | ||
1794 | #[test] | 1794 | #[test] |
1795 | fn bug_1030() { | ||
1796 | assert_snapshot_matches!(infer(r#" | ||
1797 | struct HashSet<T, H>; | ||
1798 | struct FxHasher; | ||
1799 | type FxHashSet<T> = HashSet<T, FxHasher>; | ||
1800 | |||
1801 | impl<T, H> HashSet<T, H> { | ||
1802 | fn default() -> HashSet<T, H> {} | ||
1803 | } | ||
1804 | |||
1805 | pub fn main_loop() { | ||
1806 | FxHashSet::default(); | ||
1807 | } | ||
1808 | "#), | ||
1809 | @r###" | ||
1810 | [144; 146) '{}': () | ||
1811 | [169; 198) '{ ...t(); }': () | ||
1812 | [175; 193) 'FxHash...efault': fn default<{unknown}, {unknown}>() -> HashSet<T, H> | ||
1813 | [175; 195) 'FxHash...ault()': HashSet<{unknown}, {unknown}>"### | ||
1814 | ); | ||
1815 | } | ||
1816 | |||
1817 | #[test] | ||
1795 | fn cross_crate_associated_method_call() { | 1818 | fn cross_crate_associated_method_call() { |
1796 | let (mut db, pos) = MockDatabase::with_position( | 1819 | let (mut db, pos) = MockDatabase::with_position( |
1797 | r#" | 1820 | r#" |