Commit 63858be
committed
Refactor dyn-compatibility error and suggestions
This CL makes a number of small changes to dyn compatibility errors:
- "object safety" has been renamed to "dyn-compatibility" throughout
- "Convert to enum" suggestions are no longer generated when there
exists a type-generic impl of the trait or an impl for `dyn OtherTrait`
- Several error messages are reorganized for user readability
Additionally, the dyn compatibility error creation code has been
split out into functions.
cc rust-lang#132713
cc rust-lang#1332671 parent 4ed8cf4 commit 63858be
File tree
170 files changed
+1291
-1065
lines changed- compiler
- rustc_feature/src
- rustc_hir_analysis/src
- coherence
- hir_ty_lowering
- rustc_trait_selection/src
- error_reporting/traits
- traits
- tests
- rustdoc-ui
- issues
- ui
- associated-consts
- associated-item
- async-await
- async-fn
- in-trait
- coherence
- const-generics
- adt_const_params
- generic_const_exprs
- did_you_mean
- dyn-compatibility
- error-codes
- feature-gates
- generic-associated-types
- parse
- higher-ranked/trait-bounds
- impl-trait
- in-trait
- issues
- kindck
- resolve
- self
- statics
- suggestions
- traits
- alias
- non_lifetime_binders
- object
- type
- wf
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
170 files changed
+1291
-1065
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
| 273 | + | |
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
Lines changed: 6 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
| 115 | + | |
| 116 | + | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
126 | 121 | | |
127 | 122 | | |
128 | 123 | | |
| |||
291 | 286 | | |
292 | 287 | | |
293 | 288 | | |
294 | | - | |
| 289 | + | |
295 | 290 | | |
296 | 291 | | |
297 | 292 | | |
| |||
Lines changed: 101 additions & 79 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
| 435 | + | |
435 | 436 | | |
436 | 437 | | |
437 | 438 | | |
438 | 439 | | |
439 | | - | |
| 440 | + | |
440 | 441 | | |
441 | 442 | | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
462 | 447 | | |
463 | 448 | | |
464 | 449 | | |
| |||
473 | 458 | | |
474 | 459 | | |
475 | 460 | | |
476 | | - | |
| 461 | + | |
477 | 462 | | |
478 | 463 | | |
479 | 464 | | |
| |||
490 | 475 | | |
491 | 476 | | |
492 | 477 | | |
493 | | - | |
| 478 | + | |
494 | 479 | | |
495 | 480 | | |
496 | 481 | | |
497 | 482 | | |
498 | 483 | | |
499 | 484 | | |
500 | 485 | | |
501 | | - | |
502 | | - | |
503 | | - | |
| 486 | + | |
| 487 | + | |
504 | 488 | | |
505 | 489 | | |
506 | 490 | | |
507 | 491 | | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | 492 | | |
512 | 493 | | |
513 | 494 | | |
| |||
518 | 499 | | |
519 | 500 | | |
520 | 501 | | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
521 | 515 | | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
536 | 544 | | |
537 | 545 | | |
538 | 546 | | |
539 | | - | |
540 | | - | |
541 | | - | |
| 547 | + | |
542 | 548 | | |
543 | 549 | | |
544 | 550 | | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
576 | 571 | | |
| 572 | + | |
577 | 573 | | |
578 | 574 | | |
579 | | - | |
| 575 | + | |
580 | 576 | | |
581 | 577 | | |
582 | 578 | | |
| 579 | + | |
583 | 580 | | |
584 | | - | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
585 | 607 | | |
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
105 | | - | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
| 298 | + | |
298 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
299 | 304 | | |
300 | 305 | | |
301 | | - | |
| 306 | + | |
302 | 307 | | |
| 308 | + | |
303 | 309 | | |
304 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
305 | 316 | | |
306 | 317 | | |
307 | 318 | | |
308 | 319 | | |
309 | | - | |
| 320 | + | |
310 | 321 | | |
311 | 322 | | |
312 | 323 | | |
| |||
0 commit comments