Skip to content

Conversation

emberian
Copy link
Contributor

@emberian emberian commented Aug 4, 2013

No description provided.

@brson
Copy link
Contributor

brson commented Aug 4, 2013

Does span_to_snippet always fail? Are you sure this isn't a rustdoc bug?

At the least, please put some comments in explaining this is a workaround and linking to the issue.

@brson
Copy link
Contributor

brson commented Aug 4, 2013

As an aside, resolve looking for "::" in the code snippet in order to do diagnostics (and diagnostics of questionable value and correctness) is pretty crummy.

@emberian
Copy link
Contributor Author

emberian commented Aug 4, 2013

It does not always fail. I'm not 100% sure it's not a rustdoc bug, but I'm just giving it a span I get from the AST for an expr, and I wouldn't think it'd ever fail for a span I get from the AST.

@emberian
Copy link
Contributor Author

emberian commented Aug 4, 2013

Yes, that error message was my first PR, it was the only way I could figure out how to do it at the time. Blame whoever r+'d it 😉

bors added a commit that referenced this pull request Aug 6, 2013
@bors bors closed this Aug 6, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jan 27, 2022
…elf-ty, r=xFrednet

`needless_lifetimes`: ignore lifetimes in explicit self types

changelog: false positive fix: [`needless_lifetimes`] no longer lints lifetimes in explicit self types

They're not currently elidable (rust-lang#69064)

Fixes rust-lang#7296
bors pushed a commit to rust-lang-ci/rust that referenced this pull request Jan 28, 2025
…ng#13992)

Commit 9ef6e21 introduced a check to
ensure that Clippy doesn't consider a lifetime present in an explicit
self types as being the default for an elided output lifetime. For
example, elision did not work in the case like:

```rust
  fn func(self: &Rc<Self>, &str) -> &str { … }
```

Since Rust 1.81.0, the lifetime in the self type is now considered the
default for elision. Elision should then be suggested when appropriate.

changelog: [`needless_lifetimes`]: suggest elision of lifetimes present
in explicit self types as well

r? @Alexendoo
because of rust-lang#8278
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants