Skip to content

Commit c37d1c5

Browse files
committed
Restore a mark
1 parent 6d64798 commit c37d1c5

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

crates/ra_hir_def/src/body/lower.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use ra_syntax::{
1212
},
1313
AstNode, AstPtr,
1414
};
15+
use test_utils::tested_by;
1516

1617
use crate::{
1718
body::{Body, BodySourceMap, Expander, PatPtr},
@@ -153,6 +154,7 @@ where
153154
None => self.collect_expr_opt(condition.expr()),
154155
// if let -- desugar to match
155156
Some(pat) => {
157+
tested_by!(infer_resolve_while_let);
156158
let pat = self.collect_pat(pat);
157159
let match_expr = self.collect_expr_opt(condition.expr());
158160
let placeholder_pat = self.missing_pat();

crates/ra_hir_def/src/body/scope.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ mod tests {
174174
use hir_expand::{name::AsName, Source};
175175
use ra_db::{fixture::WithFixture, FileId, SourceDatabase};
176176
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};
178178

179179
use crate::{db::DefDatabase2, test_db::TestDB, FunctionId, ModuleDefId};
180180

@@ -382,4 +382,20 @@ mod tests {
382382
53,
383383
);
384384
}
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+
}
385401
}

crates/ra_hir_def/src/marks.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ test_utils::marks!(
1111
prelude_is_macro_use
1212
macro_dollar_crate_self
1313
macro_dollar_crate_other
14+
infer_resolve_while_let
1415
);

0 commit comments

Comments
 (0)