Skip to content

ZeroVec Yoke impl started failing "forget-copy" on Nightly #3436

@sffc

Description

@sffc

The error is:

error: calls to `std::mem::forget` with a value that implements `Copy` does nothing
   --> utils/zerovec/src/yoke_impls.rs:174:13
    |
174 |             mem::forget(self);
    |             ^^^^^^^^^^^^----^
    |                         |
    |                         argument has type `map::borrowed::ZeroMapBorrowed<'_, K, V>`
    |
    = note: use `let _ = ...` to ignore the expression or result
    = note: `-D forget-copy` implied by `-D warnings`

error: calls to `std::mem::forget` with a value that implements `Copy` does nothing
   --> utils/zerovec/src/yoke_impls.rs:182:9
    |
182 |         mem::forget(from);
    |         ^^^^^^^^^^^^----^
    |                     |
    |                     argument has type `map::borrowed::ZeroMapBorrowed<'_, K, V>`
    |
    = note: use `let _ = ...` to ignore the expression or result

error: calls to `std::mem::forget` with a value that implements `Copy` does nothing
   --> utils/zerovec/src/yoke_impls.rs:2[70](https://github.com/unicode-org/icu4x/actions/runs/4981308660/jobs/8915392667#step:8:71):13
    |
270 |             mem::forget(self);
    |             ^^^^^^^^^^^^----^
    |                         |
    |                         argument has type `map2d::borrowed::ZeroMap2dBorrowed<'_, K0, K1, V>`
    |
    = note: use `let _ = ...` to ignore the expression or result

error: calls to `std::mem::forget` with a value that implements `Copy` does nothing
   --> utils/zerovec/src/yoke_impls.rs:278:9
    |
278 |         mem::forget(from);
    |         ^^^^^^^^^^^^----^
    |                     |
    |                     argument has type `map2d::borrowed::ZeroMap2dBorrowed<'_, K0, K1, V>`
    |
    = note: use `let _ = ...` to ignore the expression or result

It seems harmless to fix, but I would really like to stop breaking clients; see #3425

However, it appears to only be a lint, so we might be good if we patch the lint.

CC @Manishearth

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-zerovecComponent: Yoke, ZeroVec, DataBakeT-bugType: Bad behavior, security, privacy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions