Commit fa195d8
Fix unsafe blocks in s![] macro
Before, the user could silently violate safety requirements of
`SliceInfo::new_unchecked` by directly calling `s![@parse
inconsistent_values]`, where `inconsistent_values` represents
inconsistent values for the dimensions, etc. Now, the macro calls
`SliceInfo::new_unchecked` only in the `($($t:tt)*)` arm, which always
constructs the correct values for the call.1 parent 54b3ffb commit fa195d8
1 file changed
Lines changed: 29 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
780 | 780 | | |
781 | 781 | | |
782 | 782 | | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
788 | | - | |
789 | | - | |
790 | | - | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
791 | 788 | | |
792 | 789 | | |
793 | 790 | | |
| |||
797 | 794 | | |
798 | 795 | | |
799 | 796 | | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
808 | 802 | | |
809 | 803 | | |
810 | 804 | | |
| |||
844 | 838 | | |
845 | 839 | | |
846 | 840 | | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
857 | 846 | | |
858 | 847 | | |
859 | 848 | | |
| |||
868 | 857 | | |
869 | 858 | | |
870 | 859 | | |
871 | | - | |
872 | | - | |
873 | | - | |
874 | | - | |
875 | | - | |
876 | | - | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
877 | 874 | | |
878 | 875 | | |
879 | 876 | | |
| |||
0 commit comments