Commit 265e484
committed
Auto merge of #6117 - dtolnay:string_lit_as_bytes, r=ebroto
Downgrade string_lit_as_bytes to nursery
Between #1402 (regarding `to_owned`) and #4494 (regarding `impl Read`), as well as other confusion I've seen hit in my work codebase involving string_lit_as_bytes (`"...".as_bytes().into()`), I don't think this lint is at a quality to be enabled by default.
I would consider re-enabling this lint after it is updated to understand when the surrounding type information is sufficient to unsize `b"..."` to &\[u8\] without causing a type error.
As currently implemented, this lint is pushing people to write `&b"_"[..]` which is not an improvement over `"_".as_bytes()` as far as I am concerned.
---
changelog: Remove string_lit_as_bytes from default set of enabled lints3 files changed
+24
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1477 | 1477 | | |
1478 | 1478 | | |
1479 | 1479 | | |
1480 | | - | |
1481 | 1480 | | |
1482 | 1481 | | |
1483 | 1482 | | |
| |||
1619 | 1618 | | |
1620 | 1619 | | |
1621 | 1620 | | |
1622 | | - | |
1623 | 1621 | | |
1624 | 1622 | | |
1625 | 1623 | | |
| |||
1831 | 1829 | | |
1832 | 1830 | | |
1833 | 1831 | | |
| 1832 | + | |
1834 | 1833 | | |
1835 | 1834 | | |
1836 | 1835 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
73 | 93 | | |
74 | 94 | | |
75 | 95 | | |
| |||
80 | 100 | | |
81 | 101 | | |
82 | 102 | | |
83 | | - | |
| 103 | + | |
84 | 104 | | |
85 | 105 | | |
86 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2161 | 2161 | | |
2162 | 2162 | | |
2163 | 2163 | | |
2164 | | - | |
| 2164 | + | |
2165 | 2165 | | |
2166 | 2166 | | |
2167 | 2167 | | |
| |||
0 commit comments