@@ -304,36 +304,19 @@ mod tests {
304
304
check_assist (
305
305
replace_derive_with_manual_impl,
306
306
r#"
307
- mod fmt {
308
- pub struct Error;
309
- pub type Result = Result<(), Error>;
310
- pub struct Formatter<'a>;
311
- pub trait Debug {
312
- fn fmt(&self, f: &mut Formatter<'_>) -> Result;
313
- }
314
- }
315
-
307
+ //- minicore: fmt
316
308
#[derive(Debu$0g)]
317
309
struct Foo {
318
310
bar: String,
319
311
}
320
312
"# ,
321
313
r#"
322
- mod fmt {
323
- pub struct Error;
324
- pub type Result = Result<(), Error>;
325
- pub struct Formatter<'a>;
326
- pub trait Debug {
327
- fn fmt(&self, f: &mut Formatter<'_>) -> Result;
328
- }
329
- }
330
-
331
314
struct Foo {
332
315
bar: String,
333
316
}
334
317
335
- impl fmt::Debug for Foo {
336
- $0fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
318
+ impl core:: fmt::Debug for Foo {
319
+ $0fn fmt(&self, f: &mut core:: fmt::Formatter<'_>) -> core:: fmt::Result {
337
320
f.debug_struct("Foo").field("bar", &self.bar).finish()
338
321
}
339
322
}
@@ -345,32 +328,14 @@ impl fmt::Debug for Foo {
345
328
check_assist (
346
329
replace_derive_with_manual_impl,
347
330
r#"
348
- mod fmt {
349
- pub struct Error;
350
- pub type Result = Result<(), Error>;
351
- pub struct Formatter<'a>;
352
- pub trait Debug {
353
- fn fmt(&self, f: &mut Formatter<'_>) -> Result;
354
- }
355
- }
356
-
331
+ //- minicore: fmt
357
332
#[derive(Debu$0g)]
358
333
struct Foo(String, usize);
359
334
"# ,
360
- r#"
361
- mod fmt {
362
- pub struct Error;
363
- pub type Result = Result<(), Error>;
364
- pub struct Formatter<'a>;
365
- pub trait Debug {
366
- fn fmt(&self, f: &mut Formatter<'_>) -> Result;
367
- }
368
- }
369
-
370
- struct Foo(String, usize);
335
+ r#"struct Foo(String, usize);
371
336
372
- impl fmt::Debug for Foo {
373
- $0fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
337
+ impl core:: fmt::Debug for Foo {
338
+ $0fn fmt(&self, f: &mut core:: fmt::Formatter<'_>) -> core:: fmt::Result {
374
339
f.debug_tuple("Foo").field(&self.0).field(&self.1).finish()
375
340
}
376
341
}
@@ -382,32 +347,15 @@ impl fmt::Debug for Foo {
382
347
check_assist (
383
348
replace_derive_with_manual_impl,
384
349
r#"
385
- mod fmt {
386
- pub struct Error;
387
- pub type Result = Result<(), Error>;
388
- pub struct Formatter<'a>;
389
- pub trait Debug {
390
- fn fmt(&self, f: &mut Formatter<'_>) -> Result;
391
- }
392
- }
393
-
350
+ //- minicore: fmt
394
351
#[derive(Debu$0g)]
395
352
struct Foo;
396
353
"# ,
397
354
r#"
398
- mod fmt {
399
- pub struct Error;
400
- pub type Result = Result<(), Error>;
401
- pub struct Formatter<'a>;
402
- pub trait Debug {
403
- fn fmt(&self, f: &mut Formatter<'_>) -> Result;
404
- }
405
- }
406
-
407
355
struct Foo;
408
356
409
- impl fmt::Debug for Foo {
410
- $0fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
357
+ impl core:: fmt::Debug for Foo {
358
+ $0fn fmt(&self, f: &mut core:: fmt::Formatter<'_>) -> core:: fmt::Result {
411
359
f.debug_struct("Foo").finish()
412
360
}
413
361
}
@@ -419,38 +367,21 @@ impl fmt::Debug for Foo {
419
367
check_assist (
420
368
replace_derive_with_manual_impl,
421
369
r#"
422
- mod fmt {
423
- pub struct Error;
424
- pub type Result = Result<(), Error>;
425
- pub struct Formatter<'a>;
426
- pub trait Debug {
427
- fn fmt(&self, f: &mut Formatter<'_>) -> Result;
428
- }
429
- }
430
-
370
+ //- minicore: fmt
431
371
#[derive(Debu$0g)]
432
372
enum Foo {
433
373
Bar,
434
374
Baz,
435
375
}
436
376
"# ,
437
377
r#"
438
- mod fmt {
439
- pub struct Error;
440
- pub type Result = Result<(), Error>;
441
- pub struct Formatter<'a>;
442
- pub trait Debug {
443
- fn fmt(&self, f: &mut Formatter<'_>) -> Result;
444
- }
445
- }
446
-
447
378
enum Foo {
448
379
Bar,
449
380
Baz,
450
381
}
451
382
452
- impl fmt::Debug for Foo {
453
- $0fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
383
+ impl core:: fmt::Debug for Foo {
384
+ $0fn fmt(&self, f: &mut core:: fmt::Formatter<'_>) -> core:: fmt::Result {
454
385
match self {
455
386
Self::Bar => write!(f, "Bar"),
456
387
Self::Baz => write!(f, "Baz"),
0 commit comments