-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestionsgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Description
warning: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> src/librustc_infer/traits/error_reporting/mod.rs:995:1
|
995 | / pub fn recursive_type_with_infinite_size_error(
996 | | tcx: TyCtxt<'tcx>,
997 | | type_def_id: DefId,
998 | | ) -> DiagnosticBuilder<'tcx> {
... |
1015 | | err
1016 | | }
| |_^
|
= note: `#[warn(clippy::needless_lifetimes)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
The generated preview spans the entire function, is this actually necessary?
Could we skip the function body and only show the signature that contains the lifetimes?
Or perhaps limit the span to the function return type instead of the end of the function?:
--> src/librustc_infer/traits/error_reporting/mod.rs:995:1
|
995 | / pub fn recursive_type_with_infinite_size_error(
996 | | tcx: TyCtxt<'tcx>,
997 | | type_def_id: DefId,
998 | | ) -> DiagnosticBuilder<'tcx> {
... | |______________________________^
|
= note: `#[warn(clippy::needless_lifetimes)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestionsgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy