Commit e65c6e5
committed
Rollup merge of rust-lang#23625 - fhahn:issue-23620-ice-unicode-bytestring, r=alexcrichton
closes rust-lang#23620
This PR patches the issue mentioned in rust-lang#23620, but there is also an ICE for invalid escape sequences in byte literals. This is due to the fact that the `scan_byte` function returns ` token::intern(\"??\") ` for invalid bytes, resulting in an ICE later on. Is there a reason for this behavior? Shouldn't `scan_byte` fail when it encounters an invalid byte?
And I noticed a small inconsistency in the documentation. According to the formal byte literal definition in http://doc.rust-lang.org/reference.html#byte-and-byte-string-literals , a byte string literal contains `string_body *`, but according to the text (and the behavior of the lexer) it should not accept unicode escape sequences. Hence it should be replaced by `byte_body *`. If this is valid, I can add this fix to this PR.File tree
3 files changed
+78
-12
lines changed- src
- libsyntax/parse/lexer
- test/parse-fail
3 files changed
+78
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
742 | 742 | | |
743 | 743 | | |
744 | 744 | | |
| 745 | + | |
745 | 746 | | |
746 | 747 | | |
747 | 748 | | |
| |||
750 | 751 | | |
751 | 752 | | |
752 | 753 | | |
| 754 | + | |
753 | 755 | | |
754 | 756 | | |
755 | 757 | | |
756 | 758 | | |
757 | 759 | | |
758 | 760 | | |
759 | 761 | | |
| 762 | + | |
| 763 | + | |
760 | 764 | | |
761 | 765 | | |
762 | 766 | | |
| |||
767 | 771 | | |
768 | 772 | | |
769 | 773 | | |
| 774 | + | |
770 | 775 | | |
771 | 776 | | |
772 | 777 | | |
773 | | - | |
| 778 | + | |
774 | 779 | | |
775 | 780 | | |
776 | 781 | | |
| |||
799 | 804 | | |
800 | 805 | | |
801 | 806 | | |
802 | | - | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
803 | 819 | | |
804 | 820 | | |
805 | 821 | | |
| |||
869 | 885 | | |
870 | 886 | | |
871 | 887 | | |
| 888 | + | |
872 | 889 | | |
873 | 890 | | |
874 | 891 | | |
| |||
884 | 901 | | |
885 | 902 | | |
886 | 903 | | |
887 | | - | |
| 904 | + | |
888 | 905 | | |
889 | 906 | | |
| 907 | + | |
| 908 | + | |
890 | 909 | | |
891 | 910 | | |
892 | 911 | | |
893 | 912 | | |
894 | 913 | | |
895 | 914 | | |
896 | | - | |
| 915 | + | |
897 | 916 | | |
| 917 | + | |
898 | 918 | | |
899 | 919 | | |
900 | 920 | | |
901 | 921 | | |
902 | | - | |
903 | | - | |
904 | | - | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
905 | 925 | | |
906 | 926 | | |
907 | | - | |
908 | | - | |
909 | | - | |
| 927 | + | |
910 | 928 | | |
911 | 929 | | |
912 | 930 | | |
| |||
1330 | 1348 | | |
1331 | 1349 | | |
1332 | 1350 | | |
1333 | | - | |
| 1351 | + | |
1334 | 1352 | | |
1335 | 1353 | | |
1336 | 1354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
0 commit comments