Skip to content

🐛 compiling from source creates warnings - hiding a lifetime that's elided elsewhere is confusing #2050

@danie-dejager

Description

@danie-dejager

Building 0.18.2 from source with rustc 1.90.0.

   Compiling git-delta v0.18.2 (/builddir/build/BUILD/delta-0.18.2)
warning: hiding a lifetime that's elided elsewhere is confusing
   --> src/ansi/mod.rs:103:30
    |
103 | pub fn truncate_str_short(s: &str, display_width: usize) -> Cow<str> {
    |                              ^^^^                           -------- the same lifetime is hidden here
    |                              |
    |                              the lifetime is elided here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
    |
103 | pub fn truncate_str_short(s: &str, display_width: usize) -> Cow<'_, str> {
    |                                                                 +++

warning: hiding a lifetime that's elided elsewhere is confusing
   --> src/handlers/grep.rs:667:30
    |
667 | pub fn parse_grep_line(line: &str) -> Option<GrepLine> {
    |                              ^^^^            -------- the same lifetime is hidden here
    |                              |
    |                              the lifetime is elided here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
    |
667 | pub fn parse_grep_line(line: &str) -> Option<GrepLine<'_>> {
    |                                                      ++++

warning: hiding a lifetime that's elided elsewhere is confusing
   --> src/handlers/grep.rs:685:38
    |
685 | pub fn parse_raw_grep_line(raw_line: &str) -> Option<GrepLine> {
    |                                      ^^^^            -------- the same lifetime is hidden here
    |                                      |
    |                                      the lifetime is elided here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
    |
685 | pub fn parse_raw_grep_line(raw_line: &str) -> Option<GrepLine<'_>> {
    |                                                              ++++

warning: hiding a lifetime that's elided elsewhere is confusing
  --> src/handlers/ripgrep_json.rs:11:25
   |
11 | pub fn parse_line(line: &str) -> Option<grep::GrepLine> {
   |                         ^^^^            -------------- the same lifetime is hidden here
   |                         |
   |                         the lifetime is elided here
   |
   = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
   |
11 | pub fn parse_line(line: &str) -> Option<grep::GrepLine<'_>> {
   |                                                       ++++

warning: hiding a lifetime that's elided elsewhere is confusing
   --> src/paint.rs:780:41
    |
780 | fn painted_prefix(state: State, config: &config::Config) -> Option<ANSIString> {
    |                                         ^^^^^^^^^^^^^^^            ---------- the same lifetime is hidden here
    |                                         |
    |                                         the lifetime is elided here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
    |
780 | fn painted_prefix(state: State, config: &config::Config) -> Option<ANSIString<'_>> {
    |                                                                              ++++

warning: `git-delta` (bin "delta") generated 5 warnings
    Finished `release` profile [optimized] target(s) in 1m 15s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions