about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-07-26 18:57:05 +0200
committerGitHub <noreply@github.com>2019-07-26 18:57:05 +0200
commit3a1ee9b70d72ac20b095a86696e46ee65d4eaa8d (patch)
tree3a7c42a4b19a86a84fe58e58f249e96bbe64abf9 /src
parent8882e424f8d2826388d965d1719b33824b82dd23 (diff)
parent328447279d8247dcf3341fb1ed58fc39ba871ae3 (diff)
downloadrust-3a1ee9b70d72ac20b095a86696e46ee65d4eaa8d.tar.gz
rust-3a1ee9b70d72ac20b095a86696e46ee65d4eaa8d.zip
Rollup merge of #63004 - JohnTitor:add-tests-for-54062, r=Centril
Add test for issue-54062

The ICE is no longer reproduced.

Closes #54062
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/issues/issue-54062.rs13
-rw-r--r--src/test/ui/issues/issue-54062.stderr16
2 files changed, 29 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-54062.rs b/src/test/ui/issues/issue-54062.rs
new file mode 100644
index 00000000000..495b7343f20
--- /dev/null
+++ b/src/test/ui/issues/issue-54062.rs
@@ -0,0 +1,13 @@
+use std::sync::Mutex;
+
+struct Test {
+    comps: Mutex<String>,
+}
+
+fn main() {}
+
+fn testing(test: Test) {
+    let _ = test.comps.inner.lock().unwrap();
+    //~^ ERROR: field `inner` of struct `std::sync::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
new file mode 100644
index 00000000000..082ac91edb1
--- /dev/null
+++ b/src/test/ui/issues/issue-54062.stderr
@@ -0,0 +1,16 @@
+error[E0616]: field `inner` of struct `std::sync::Mutex` is private
+  --> $DIR/issue-54062.rs:10:13
+   |
+LL |     let _ = test.comps.inner.lock().unwrap();
+   |             ^^^^^^^^^^^^^^^^
+
+error[E0599]: no method named `unwrap` found for type `std::sys_common::mutex::MutexGuard<'_>` in the current scope
+  --> $DIR/issue-54062.rs:10:37
+   |
+LL |     let _ = test.comps.inner.lock().unwrap();
+   |                                     ^^^^^^
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0599, E0616.
+For more information about an error, try `rustc --explain E0599`.