Commit 1e6fe58
committed
Auto merge of #94079 - petrochenkov:cstr, r=joshtriplett
library: Move `CStr` to libcore, and `CString` to liballoc
Closes #46736
Interesting points:
- Stability:
- To make `CStr(ing)` from libcore/liballoc unusable without enabling features I had to make these structures unstable, and reexport them from libstd using stable type aliases instead of `pub use` reexports. (Because stability of `use` items is not checked.)
- Relying on target ABI in libcore is ok:
- #94079 (comment)
- `trait CStrExt` (UPDATE: used only in `cfg(bootstrap)` mode, otherwise lang items are used instead)
- #94079 (comment)
- `strlen`
- #94079 (comment)
Otherwise it's just a code move + some minor hackery usual for liballoc in `cfg(test)` mode.File tree
28 files changed
+940
-695
lines changed- compiler
- rustc_hir/src
- rustc_metadata/src
- rmeta
- rustc_typeck/src
- check/method
- coherence
- library
- alloc
- src
- ffi
- c_str
- tests
- core/src
- ffi
- std
- src
- ffi
- prelude
- sys
- hermit
- sgx
- solid
- unix
- unsupported
- windows
- src/tools/clippy/clippy_utils/src
28 files changed
+940
-695
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
731 | 731 | | |
732 | 732 | | |
733 | 733 | | |
734 | | - | |
| 734 | + | |
735 | 735 | | |
736 | | - | |
| 736 | + | |
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| 329 | + | |
| 330 | + | |
329 | 331 | | |
330 | 332 | | |
331 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
| 420 | + | |
420 | 421 | | |
421 | 422 | | |
422 | 423 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
1737 | 1737 | | |
1738 | 1738 | | |
1739 | 1739 | | |
| 1740 | + | |
1740 | 1741 | | |
1741 | 1742 | | |
1742 | 1743 | | |
| |||
1752 | 1753 | | |
1753 | 1754 | | |
1754 | 1755 | | |
1755 | | - | |
1756 | | - | |
1757 | | - | |
1758 | | - | |
1759 | | - | |
1760 | 1756 | | |
1761 | 1757 | | |
1762 | 1758 | | |
| |||
1765 | 1761 | | |
1766 | 1762 | | |
1767 | 1763 | | |
1768 | | - | |
| 1764 | + | |
1769 | 1765 | | |
1770 | 1766 | | |
1771 | 1767 | | |
1772 | | - | |
| 1768 | + | |
1773 | 1769 | | |
1774 | 1770 | | |
1775 | 1771 | | |
| |||
1786 | 1782 | | |
1787 | 1783 | | |
1788 | 1784 | | |
1789 | | - | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
1790 | 1796 | | |
1791 | 1797 | | |
1792 | 1798 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
647 | | - | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
648 | 652 | | |
649 | 653 | | |
650 | 654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
| |||
0 commit comments