diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-04 19:55:23 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-04 19:55:23 +0000 |
commit | 4a3ef8fe63c5eedfbb6d3038e88f0b1349a1c382 (patch) | |
tree | a2666ef628451437aea9b99a9e18d27bb54b53e8 /crates/ra_analysis/tests/test/main.rs | |
parent | 04e6b26758003550633e41df14fe9bc0ac7f8e4a (diff) | |
parent | e6aeabf96f9cf339c81f3e79502d477269d141ed (diff) |
Merge #370
370: Self params & type r=matklad a=flodiebold
This implements type inference for `self`, so field completion for methods taking `self` works now.
- rename `IMPL_ITEM` to `IMPL_BLOCK` -- rustc calls the methods etc. inside an impl `ImplItem`s, and the impl itself doesn't define an item, so I thought this name was clearer.
- add HIR for impl blocks -- we collect all impls in a crate at once, so we can go from methods to containing impls, and since we will later also need to find all impls for a certain type (which may be anywhere in the crate, I think?). We could be more lazy here, but I don't know if it's worth the complexity.
- resolve `self` and `Self` during type inference
- refactor a bit in ty.rs as well
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_analysis/tests/test/main.rs')
-rw-r--r-- | crates/ra_analysis/tests/test/main.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_analysis/tests/test/main.rs b/crates/ra_analysis/tests/test/main.rs index 859778024..beeae1e19 100644 --- a/crates/ra_analysis/tests/test/main.rs +++ b/crates/ra_analysis/tests/test/main.rs | |||
@@ -138,14 +138,14 @@ fn test_resolve_parent_module_for_inline() { | |||
138 | fn test_resolve_crate_root() { | 138 | fn test_resolve_crate_root() { |
139 | let mock = MockAnalysis::with_files( | 139 | let mock = MockAnalysis::with_files( |
140 | " | 140 | " |
141 | //- /lib.rs | 141 | //- /bar.rs |
142 | mod foo; | 142 | mod foo; |
143 | //- /foo.rs | 143 | //- /bar/foo.rs |
144 | // emtpy <|> | 144 | // emtpy <|> |
145 | ", | 145 | ", |
146 | ); | 146 | ); |
147 | let root_file = mock.id_of("/lib.rs"); | 147 | let root_file = mock.id_of("/bar.rs"); |
148 | let mod_file = mock.id_of("/foo.rs"); | 148 | let mod_file = mock.id_of("/bar/foo.rs"); |
149 | let mut host = mock.analysis_host(); | 149 | let mut host = mock.analysis_host(); |
150 | assert!(host.analysis().crate_for(mod_file).unwrap().is_empty()); | 150 | assert!(host.analysis().crate_for(mod_file).unwrap().is_empty()); |
151 | 151 | ||