Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Self to avoid new elided_named_lifetime warning. #1143

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

waywardmonkeys
Copy link
Contributor

Current nightly Rust has a new warning about elided named lifetimes enabled by default:

https://doc.rust-lang.org/nightly/rustc/lints/listing/warn-by-default.html#elided-named-lifetimes

@waywardmonkeys
Copy link
Contributor Author

Without this:

warning: elided lifetime has a name
   --> read-fonts/src/collections/int_set/bitset.rs:600:49
    |
599 | impl<'a> BitSetBuilder<'a> {
    |      -- lifetime `'a` declared here
600 |     pub(crate) fn start(set: &'a mut BitSet) -> BitSetBuilder {
    |                                                 ^^^^^^^^^^^^^ this elided lifetime gets resolved as `'a`
    |
    = note: `#[warn(elided_named_lifetimes)]` on by default

warning: elided lifetime has a name
  --> read-fonts/src/collections/int_set/input_bit_stream.rs:66:57
   |
44 | impl<'a, const BF: u8> InputBitStream<'a, BF> {
   |      -- lifetime `'a` declared here
...
66 |     pub(crate) fn from(data: &'a [u8]) -> InputBitStream<BF> {
   |                                                         ^ this elided lifetime gets resolved as `'a`

Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@cmyr cmyr merged commit 3aa22e6 into googlefonts:main Sep 10, 2024
8 checks passed
@waywardmonkeys waywardmonkeys deleted the elided-named-lifetimes branch September 11, 2024 02:34
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.

2 participants