Skip to content

warning: hiding a lifetime that's elided elsewhere is confusing #179

@danie-dejager

Description

@danie-dejager

I'm compiling jless 0.9.0 on rhel 9 with rustc 1.90.0 and get the following warnings:

   Compiling jless v0.9.0 (/builddir/build/BUILD/jless-0.9.0)
warning: methods `clear_screen`, `output`, and `clear_output` are never used
  --> src/terminal.rs:57:8
   |
56 | pub trait Terminal: Write {
   |           -------- methods in this trait
57 |     fn clear_screen(&mut self) -> Result;
   |        ^^^^^^^^^^^^
...
72 |     fn output(&self) -> &str;
   |        ^^^^^^
...
75 |     fn clear_output(&mut self);
   |        ^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: hiding a lifetime that's elided elsewhere is confusing
  --> src/search.rs:94:56
   |
94 |     fn invert_square_and_curly_bracket_escaping(regex: &str) -> 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
   |
94 |     fn invert_square_and_curly_bracket_escaping(regex: &str) -> Cow<'_, str> {
   |                                                                     +++

warning: hiding a lifetime that's elided elsewhere is confusing
   --> src/search.rs:236:25
    |
236 |     pub fn matches_iter(&self, range_start: usize) -> MatchRangeIter {
    |                         ^^^^^                         -------------- 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
    |
236 |     pub fn matches_iter(&self, range_start: usize) -> MatchRangeIter<'_> {
    |                                                                     ++++

warning: `jless` (bin "jless") generated 3 warnings
    Finished `release` profile [optimized] target(s) in 22.62s

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