Skip to content

Commit

Permalink
enable should_panic_without_expect lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bircni committed Oct 2, 2024
1 parent 1406e87 commit 24947bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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

0 comments on commit 24947bf

Please sign in to comment.