diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-21 12:50:12 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-21 12:50:12 +0000 |
commit | 1f61915bde4c5d8d4fe2e9b8dfa9445008730b79 (patch) | |
tree | a6fd0b6ad8b6c87d28e6e1b36bb9b2fbae2c1b09 /crates/ra_hir_def/src/body/scope.rs | |
parent | 612a72fc4ea4376920f2a7da7b3c334227c1716c (diff) | |
parent | c37d1c5b381365ce2d07dfe4b871e43995ccea2d (diff) |
Merge #2337
2337: Move resolver to hir_def r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/body/scope.rs')
-rw-r--r-- | crates/ra_hir_def/src/body/scope.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/body/scope.rs b/crates/ra_hir_def/src/body/scope.rs index aeb71ff22..5d7d17231 100644 --- a/crates/ra_hir_def/src/body/scope.rs +++ b/crates/ra_hir_def/src/body/scope.rs | |||
@@ -174,7 +174,7 @@ mod tests { | |||
174 | use hir_expand::{name::AsName, Source}; | 174 | use hir_expand::{name::AsName, Source}; |
175 | use ra_db::{fixture::WithFixture, FileId, SourceDatabase}; | 175 | use ra_db::{fixture::WithFixture, FileId, SourceDatabase}; |
176 | use ra_syntax::{algo::find_node_at_offset, ast, AstNode}; | 176 | use ra_syntax::{algo::find_node_at_offset, ast, AstNode}; |
177 | use test_utils::{assert_eq_text, extract_offset}; | 177 | use test_utils::{assert_eq_text, covers, extract_offset}; |
178 | 178 | ||
179 | use crate::{db::DefDatabase2, test_db::TestDB, FunctionId, ModuleDefId}; | 179 | use crate::{db::DefDatabase2, test_db::TestDB, FunctionId, ModuleDefId}; |
180 | 180 | ||
@@ -382,4 +382,20 @@ mod tests { | |||
382 | 53, | 382 | 53, |
383 | ); | 383 | ); |
384 | } | 384 | } |
385 | |||
386 | #[test] | ||
387 | fn infer_resolve_while_let() { | ||
388 | covers!(infer_resolve_while_let); | ||
389 | do_check_local_name( | ||
390 | r#" | ||
391 | fn test() { | ||
392 | let foo: Option<f32> = None; | ||
393 | while let Option::Some(spam) = foo { | ||
394 | spam<|> | ||
395 | } | ||
396 | } | ||
397 | "#, | ||
398 | 75, | ||
399 | ); | ||
400 | } | ||
385 | } | 401 | } |