Skip to content

[significant_drop_tightening] Functions that return literals should not trigger the lint #11160

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

Closed
c410-f3r opened this issue Jul 14, 2023 · 0 comments · Fixed by #11161
Closed

Comments

@c410-f3r
Copy link
Contributor

c410-f3r commented Jul 14, 2023

Literals are cheap expressions that won't interfere with the release of a lock.

pub fn foo() -> bool {
    let mutex = Mutex::new(1i32);
    let lock = mutex.lock().unwrap();
    let _ = lock.abs();
    true
}

cc #11125 (comment)

c410-f3r added a commit to c410-f3r/rust-clippy that referenced this issue Jul 14, 2023
bors added a commit that referenced this issue Jul 20, 2023
[significant_drop_tightening] Fix #11160

Fix #11160

```
changelog: [`significant_drop_tightening`]: Ignore literals in function returns
```
@bors bors closed this as completed in 1f82f6d Jul 20, 2023
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 a pull request may close this issue.

1 participant