Skip to content

uuid! index is out of bounds in clippy on rust 1.77 (fixed in uuid 1.6.1) #741

@eric-seppanen

Description

@eric-seppanen

I'm filing this just so others can find it quickly; it appears to be fixed in uuid >= 1.6.1.

This code fails with a hard error in clippy 1.77 (currently in beta), in uuid 1.0.0 .. 1.5.0 :

pub const SOME_UUID: Uuid = uuid!("11111111-1111-2222-3333-444444444444");

The error is

$ cargo +beta clippy
    Checking test_uuid_indexing v0.1.0
error: index is out of bounds
 --> src/lib.rs:4:29
  |
4 | pub const SOME_UUID: Uuid = uuid!("11111111-1111-2222-3333-444444444444");
  |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#out_of_bounds_indexing
  = note: `#[deny(clippy::out_of_bounds_indexing)]` on by default
  = note: this error originates in the macro `uuid` (in Nightly builds, run with -Z macro-backtrace for more info)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions