diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2020-09-24 17:11:16 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2020-09-27 10:08:00 +0200 |
| commit | 825dda80601bdb34ef21065052a8866df0fe0838 (patch) | |
| tree | 389e2c3c93080b46e436e4c1d35719faaf5dc31e /src/test/ui | |
| parent | 6f6336b4a187b03312b978703496ea0ee9020ec9 (diff) | |
| download | rust-825dda80601bdb34ef21065052a8866df0fe0838.tar.gz rust-825dda80601bdb34ef21065052a8866df0fe0838.zip | |
Fix ui test.
This test checks if the compiler complains about accesing a private field before complaining (or crashing) about the private function on it not marked as stable/unstable. The interface of the internal type (sys_common's Mutex) used for this was changed. With this change, it uses another function to test for the same issue.
Diffstat (limited to 'src/test/ui')
| -rw-r--r-- | src/test/ui/issues/issue-54062.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-54062.stderr | 13 |
2 files changed, 4 insertions, 12 deletions
diff --git a/src/test/ui/issues/issue-54062.rs b/src/test/ui/issues/issue-54062.rs index 60a9b00d5d4..093d6601d4e 100644 --- a/src/test/ui/issues/issue-54062.rs +++ b/src/test/ui/issues/issue-54062.rs @@ -7,7 +7,6 @@ struct Test { fn main() {} fn testing(test: Test) { - let _ = test.comps.inner.lock().unwrap(); + let _ = test.comps.inner.try_lock(); //~^ ERROR: field `inner` of struct `Mutex` is private - //~| ERROR: no method named `unwrap` found } diff --git a/src/test/ui/issues/issue-54062.stderr b/src/test/ui/issues/issue-54062.stderr index e9e8080d467..5361ee1d345 100644 --- a/src/test/ui/issues/issue-54062.stderr +++ b/src/test/ui/issues/issue-54062.stderr @@ -1,16 +1,9 @@ error[E0616]: field `inner` of struct `Mutex` is private --> $DIR/issue-54062.rs:10:24 | -LL | let _ = test.comps.inner.lock().unwrap(); +LL | let _ = test.comps.inner.try_lock(); | ^^^^^ private field -error[E0599]: no method named `unwrap` found for struct `std::sys_common::mutex::MutexGuard<'_>` in the current scope - --> $DIR/issue-54062.rs:10:37 - | -LL | let _ = test.comps.inner.lock().unwrap(); - | ^^^^^^ method not found in `std::sys_common::mutex::MutexGuard<'_>` - -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors have detailed explanations: E0599, E0616. -For more information about an error, try `rustc --explain E0599`. +For more information about this error, try `rustc --explain E0616`. |
