Skip to content

mutable_key_type doesn't recursively consider ignore_interior_mutability config #9801

Closed
@Alexendoo

Description

@Alexendoo

Adding bytes::Bytes doesn't catch the FP in #5325 (comment):

use http::header::HeaderName;
use std::{collections::HashMap, str::FromStr};

fn main() {
    let mut foo = HashMap::new();
    foo.insert(HeaderName::from_str("hi").unwrap(), 3);
}

I think what's happening is that the check for self.ignore_mut_def_ids.contains is shallow, but ty.is_freeze is deep. But it might be something else as the path from HeaderName -> Bytes is fairly complex: https://docs.rs/http/latest/src/http/header/name.rs.html#33-35

cc @llogiq

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't have

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions