@@ -176,15 +176,12 @@ fn pat_is_enum_variant(db: &RootDatabase, bind_pat: &ast::IdentPat, pat_ty: &hir
176
176
mod tests {
177
177
// This module also contains tests for super::closure_ret
178
178
179
- use expect_test:: expect;
180
179
use syntax:: { TextRange , TextSize } ;
181
180
use test_utils:: extract_annotations;
182
181
183
182
use crate :: { fixture, inlay_hints:: InlayHintsConfig } ;
184
183
185
- use crate :: inlay_hints:: tests:: {
186
- check, check_expect, check_with_config, DISABLED_CONFIG , TEST_CONFIG ,
187
- } ;
184
+ use crate :: inlay_hints:: tests:: { check, check_with_config, DISABLED_CONFIG , TEST_CONFIG } ;
188
185
use crate :: ClosureReturnTypeHints ;
189
186
190
187
#[ track_caller]
@@ -278,8 +275,7 @@ fn main() {
278
275
#[ test]
279
276
fn iterator_hint_regression_issue_12674 ( ) {
280
277
// Ensure we don't crash while solving the projection type of iterators.
281
- check_expect (
282
- InlayHintsConfig { chaining_hints : true , ..DISABLED_CONFIG } ,
278
+ let ( analysis, file_id) = fixture:: file (
283
279
r#"
284
280
//- minicore: iterators
285
281
struct S<T>(T);
@@ -302,107 +298,18 @@ impl<'a, T> Iterator for SliceIter<'a, T> {
302
298
303
299
fn main(a: SliceIter<'_, Container>) {
304
300
a
305
- .filter_map(|c| Some(c.elements.iter().filter_map(|v| Some(v))))
306
- .map(|e| e);
301
+ .filter_map(|c| Some(c.elements.iter().filter_map(|v| Some(v))))
302
+ .map(|e| e);
307
303
}
308
- "# ,
309
- expect ! [ [ r#"
310
- [
311
- InlayHint {
312
- range: 484..554,
313
- kind: Chaining,
314
- label: [
315
- "impl ",
316
- InlayHintLabelPart {
317
- text: "Iterator",
318
- linked_location: Some(
319
- FileRange {
320
- file_id: FileId(
321
- 1,
322
- ),
323
- range: 2611..2619,
324
- },
325
- ),
326
- tooltip: "",
327
- },
328
- "<",
329
- InlayHintLabelPart {
330
- text: "Item",
331
- linked_location: Some(
332
- FileRange {
333
- file_id: FileId(
334
- 1,
335
- ),
336
- range: 2643..2647,
337
- },
338
- ),
339
- tooltip: "",
340
- },
341
- " = impl ",
342
- InlayHintLabelPart {
343
- text: "Iterator",
344
- linked_location: Some(
345
- FileRange {
346
- file_id: FileId(
347
- 1,
348
- ),
349
- range: 2611..2619,
350
- },
351
- ),
352
- tooltip: "",
353
- },
354
- "<",
355
- InlayHintLabelPart {
356
- text: "Item",
357
- linked_location: Some(
358
- FileRange {
359
- file_id: FileId(
360
- 1,
361
- ),
362
- range: 2643..2647,
363
- },
364
- ),
365
- tooltip: "",
366
- },
367
- " = &&str>>",
368
- ],
369
- },
370
- InlayHint {
371
- range: 484..485,
372
- kind: Chaining,
373
- label: [
374
- "",
375
- InlayHintLabelPart {
376
- text: "SliceIter",
377
- linked_location: Some(
378
- FileRange {
379
- file_id: FileId(
380
- 0,
381
- ),
382
- range: 289..298,
383
- },
384
- ),
385
- tooltip: "",
386
- },
387
- "<",
388
- InlayHintLabelPart {
389
- text: "Container",
390
- linked_location: Some(
391
- FileRange {
392
- file_id: FileId(
393
- 0,
394
- ),
395
- range: 238..247,
396
- },
397
- ),
398
- tooltip: "",
399
- },
400
- ">",
401
- ],
402
- },
403
- ]
404
- "# ] ] ,
304
+ "# ,
405
305
) ;
306
+ analysis
307
+ . inlay_hints (
308
+ & InlayHintsConfig { chaining_hints : true , ..DISABLED_CONFIG } ,
309
+ file_id,
310
+ None ,
311
+ )
312
+ . unwrap ( ) ;
406
313
}
407
314
408
315
#[ test]
0 commit comments