You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #129249 - estebank:useless-into, r=<try>
[Experimental] `<T as Into<T>>::into` lint
Running crater to see how common that pattern is. The Lint would have to be at most warn-by-default because there are a handful of cases detected that are actually perfectly reasonable (`type` aliases with per-platform `cfg`, or macros) which are now at best half-heartedly handled.
I've detected a handful of cases where we're calling `.into()` unnecessarily in the `rustc` codebase as well, and changed those.
CC #127343.
Copy file name to clipboardexpand all lines: compiler/rustc_lint/messages.ftl
+2
Original file line number
Diff line number
Diff line change
@@ -740,6 +740,8 @@ lint_reserved_prefix = prefix `{$prefix}` is unknown
740
740
lint_reserved_string = will be parsed as a guarded string in Rust 2024
741
741
.suggestion = insert whitespace here to avoid this being parsed as a guarded string in Rust 2024
742
742
743
+
lint_self_type_conversion = this conversion is useless `{$source}` to `{$target}`
744
+
743
745
lint_shadowed_into_iter =
744
746
this method call resolves to `<&{$target} as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<{$target} as IntoIterator>::into_iter` in Rust {$edition}
745
747
.use_iter_suggestion = use `.iter()` instead of `.into_iter()` to avoid ambiguity
0 commit comments