Rollup merge of #63004 - JohnTitor:add-tests-for-54062, r=Centril
Add test for issue-54062 The ICE is no longer reproduced. Closes #54062
This commit is contained in:
commit
3a1ee9b70d
2 changed files with 29 additions and 0 deletions
13
src/test/ui/issues/issue-54062.rs
Normal file
13
src/test/ui/issues/issue-54062.rs
Normal file
|
|
@ -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
|
||||
}
|
||||
16
src/test/ui/issues/issue-54062.stderr
Normal file
16
src/test/ui/issues/issue-54062.stderr
Normal file
|
|
@ -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`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue