Skip to content

I'm not sure if this is expected behavior, no deadlock is detected #144105

@HuMtk

Description

@HuMtk

I tried this code:

use std::sync::Mutex;

fn main() {
    let x = Mutex::new(0);
    println!("{}, {} ", x.lock().unwrap(), x.lock().unwrap());
}

I expected to see this happen: I thought this should have deadlock detection

Instead, this happened: But he did not detect deadlock

Meta

rustc --version --verbose:

rustc 1.87.0 (17067e9ac 2025-05-09)
binary: rustc
commit-hash: 17067e9ac6d7ecb70e50f92c1944e545188d2359
commit-date: 2025-05-09
host: x86_64-pc-windows-gnu
release: 1.87.0
LLVM version: 20.1.1
Backtrace

<backtrace>

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions