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

enable should_panic_without_expect lint #5218

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ ref_patterns = "warn"
rest_pat_in_fully_bound_structs = "warn"
same_functions_in_if_condition = "warn"
semicolon_if_nothing_returned = "warn"
should_panic_without_expect = "warn"
single_match_else = "warn"
str_to_string = "warn"
string_add = "warn"
Expand Down Expand Up @@ -257,9 +258,8 @@ zero_sized_map_values = "warn"
iter_over_hash_type = "allow"
let_underscore_untyped = "allow"
missing_assert_message = "allow"
should_panic_without_expect = "allow"
too_many_lines = "allow"
unwrap_used = "allow" # TODO(emilk): We really wanna warn on this one
unwrap_used = "allow" # TODO(emilk): We really wanna warn on this one

manual_range_contains = "allow" # this one is just worse imho
self_named_module_files = "allow" # Disabled waiting on https://github.com/rust-lang/rust-clippy/issues/9602
Expand Down
8 changes: 4 additions & 4 deletions crates/epaint/src/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,23 +447,23 @@ mod tests_rwlock {
}

#[test]
#[should_panic]
#[should_panic = "DEAD-LOCK DETECTED"]
fn rwlock_write_write_reentrancy() {
let one = RwLock::new(());
let _a1 = one.write();
let _a2 = one.write(); // panics
}

#[test]
#[should_panic]
#[should_panic = "DEAD-LOCK DETECTED"]
fn rwlock_write_read_reentrancy() {
let one = RwLock::new(());
let _a1 = one.write();
let _a2 = one.read(); // panics
}

#[test]
#[should_panic]
#[should_panic = "DEAD-LOCK DETECTED"]
fn rwlock_read_write_reentrancy() {
let one = RwLock::new(());
let _a1 = one.read();
Expand Down Expand Up @@ -505,7 +505,7 @@ mod tests_rwlock {
}

#[test]
#[should_panic]
#[should_panic = "DEAD-LOCK DETECTED"]
fn rwlock_read_foreign_read_write_reentrancy() {
use std::sync::Arc;

Expand Down
Loading