about summary refs log tree commit diff
path: root/tests/ui/privacy/private-field-access-in-mutex-54062.rs
blob: f145f9c3e529bc8fea88a1b3bbb355bcc3cd2292 (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 `Mutex` is private
}

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