Auto merge of #4683 - HMPerson1:inefficient_to_string, r=Manishearth

Add `inefficient_to_string` lint

Closes #4586

changelog: Add `inefficient_to_string` lint, which checks for calling `to_string` on `&&str`, which would bypass the `str`'s specialization
This commit is contained in:
bors
2019-10-17 23:48:55 +00:00
11 changed files with 216 additions and 4 deletions

View File

@@ -808,6 +808,7 @@ pub fn register_plugins(reg: &mut rustc_driver::plugin::Registry<'_>, conf: &Con
methods::EXPECT_FUN_CALL,
methods::FILTER_NEXT,
methods::FLAT_MAP_IDENTITY,
methods::INEFFICIENT_TO_STRING,
methods::INTO_ITER_ON_ARRAY,
methods::INTO_ITER_ON_REF,
methods::ITER_CLONED_COLLECT,
@@ -1184,6 +1185,7 @@ pub fn register_plugins(reg: &mut rustc_driver::plugin::Registry<'_>, conf: &Con
loops::MANUAL_MEMCPY,
loops::NEEDLESS_COLLECT,
methods::EXPECT_FUN_CALL,
methods::INEFFICIENT_TO_STRING,
methods::ITER_NTH,
methods::OR_FUN_CALL,
methods::SINGLE_CHAR_PATTERN,