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

mutable_key_type doesn't recursively consider ignore_interior_mutability config #9801

Closed
Alexendoo opened this issue Nov 4, 2022 · 0 comments · Fixed by #12691
Closed

mutable_key_type doesn't recursively consider ignore_interior_mutability config #9801

Alexendoo opened this issue Nov 4, 2022 · 0 comments · Fixed by #12691
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have

Comments

@Alexendoo
Copy link
Member

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

@Alexendoo Alexendoo added C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have labels Nov 4, 2022
@bors bors closed this as completed in 8eafeeb Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant