Commit 0bf018c
committed
Auto merge of #43560 - QuietMisdreavus:ref-docs, r=steveklabnik
add docs for references as a primitive
Just like #43529 did for function pointers, here is a new primitive page for references.
This PR will pull in impls on references if it's a reference to a generic type parameter. Initially i was only able to pull in impls that were re-exported from another crate; crate-local impls got a different representation in the AST, and i had to change how types were resolved when cleaning it. (This is the change at the bottom of `librustdoc/clean/mod.rs`, in `resolve_type`.) I'm unsure the full ramifications of the change, but from what it looks like, it shouldn't impact anything major. Likewise, references to generic type parameters also get the `&'a [mut]` linked to the new page.
cc @rust-lang/docs: Is this sufficient information? The listing of trait impls kinda feels redundant (especially if we can get the automated impl listing sorted again), but i still think it's useful to point out that you can use these in a generic context.
Fixes #15654File tree
3 files changed
+142
-19
lines changed- src
- librustdoc
- clean
- html
- libstd
3 files changed
+142
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1547 | 1547 | | |
1548 | 1548 | | |
1549 | 1549 | | |
| 1550 | + | |
1550 | 1551 | | |
1551 | 1552 | | |
1552 | 1553 | | |
| |||
1581 | 1582 | | |
1582 | 1583 | | |
1583 | 1584 | | |
| 1585 | + | |
1584 | 1586 | | |
1585 | 1587 | | |
1586 | 1588 | | |
| |||
1633 | 1635 | | |
1634 | 1636 | | |
1635 | 1637 | | |
| 1638 | + | |
1636 | 1639 | | |
1637 | 1640 | | |
1638 | 1641 | | |
| |||
1661 | 1664 | | |
1662 | 1665 | | |
1663 | 1666 | | |
| 1667 | + | |
1664 | 1668 | | |
1665 | 1669 | | |
1666 | 1670 | | |
| |||
2556 | 2560 | | |
2557 | 2561 | | |
2558 | 2562 | | |
| 2563 | + | |
2559 | 2564 | | |
2560 | 2565 | | |
2561 | 2566 | | |
| |||
2777 | 2782 | | |
2778 | 2783 | | |
2779 | 2784 | | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
2780 | 2788 | | |
2781 | 2789 | | |
2782 | 2790 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
665 | 665 | | |
666 | 666 | | |
667 | 667 | | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
668 | 673 | | |
669 | 674 | | |
670 | 675 | | |
671 | 676 | | |
672 | 677 | | |
673 | 678 | | |
674 | | - | |
| 679 | + | |
675 | 680 | | |
676 | 681 | | |
677 | | - | |
| 682 | + | |
678 | 683 | | |
679 | 684 | | |
680 | 685 | | |
| 686 | + | |
| 687 | + | |
681 | 688 | | |
682 | | - | |
683 | | - | |
684 | 689 | | |
685 | 690 | | |
686 | | - | |
687 | | - | |
688 | 691 | | |
689 | 692 | | |
690 | 693 | | |
691 | 694 | | |
692 | 695 | | |
693 | 696 | | |
694 | 697 | | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
| 698 | + | |
701 | 699 | | |
702 | 700 | | |
703 | 701 | | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
704 | 707 | | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
| 708 | + | |
| 709 | + | |
712 | 710 | | |
713 | 711 | | |
714 | 712 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
0 commit comments