about summary refs log tree commit diff
path: root/tests/ui/privacy/private-field-access-in-mutex-54062.rs
blob: c957e0bc7e8604b557c909a5ae6faa065f3d44bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::sync::Mutex;

struct Test {
    comps: Mutex<String>,
}

fn main() {}

fn testing(test: Test) {
    let _ = test.comps.inner.try_lock();
    //~^ ERROR: field `inner` of struct `std::sync::Mutex` is private
}

// https://github.com/rust-lang/rust/issues/54062