]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/inner_type.stderr
Rollup merge of #106805 - madsravn:master, r=compiler-errors
[rust.git] / tests / ui / suggestions / inner_type.stderr
1 error[E0599]: no method named `method` found for struct `RefCell` in the current scope
2   --> $DIR/inner_type.rs:17:16
3    |
4 LL |     other_item.method();
5    |                ^^^^^^ method not found in `RefCell<Struct<u32>>`
6    |
7 note: the method `method` exists on the type `Struct<u32>`
8   --> $DIR/inner_type.rs:9:5
9    |
10 LL |     pub fn method(&self) {}
11    |     ^^^^^^^^^^^^^^^^^^^^
12 help: use `.borrow()` to borrow the `Struct<u32>`, panicking if a mutable borrow exists
13    |
14 LL |     other_item.borrow().method();
15    |               +++++++++
16
17 error[E0599]: no method named `some_mutable_method` found for struct `RefCell` in the current scope
18   --> $DIR/inner_type.rs:21:16
19    |
20 LL |     other_item.some_mutable_method();
21    |                ^^^^^^^^^^^^^^^^^^^ method not found in `RefCell<Struct<u32>>`
22    |
23 note: the method `some_mutable_method` exists on the type `Struct<u32>`
24   --> $DIR/inner_type.rs:11:5
25    |
26 LL |     pub fn some_mutable_method(&mut self) {}
27    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28 help: use `.borrow_mut()` to mutably borrow the `Struct<u32>`, panicking if any borrows exist
29    |
30 LL |     other_item.borrow_mut().some_mutable_method();
31    |               +++++++++++++
32
33 error[E0599]: no method named `method` found for struct `Mutex` in the current scope
34   --> $DIR/inner_type.rs:27:18
35    |
36 LL |     another_item.method();
37    |                  ^^^^^^ method not found in `Mutex<Struct<u32>>`
38    |
39 note: the method `method` exists on the type `Struct<u32>`
40   --> $DIR/inner_type.rs:9:5
41    |
42 LL |     pub fn method(&self) {}
43    |     ^^^^^^^^^^^^^^^^^^^^
44 help: use `.lock().unwrap()` to borrow the `Struct<u32>`, blocking the current thread until it can be acquired
45    |
46 LL |     another_item.lock().unwrap().method();
47    |                 ++++++++++++++++
48
49 error[E0599]: no method named `method` found for struct `RwLock` in the current scope
50   --> $DIR/inner_type.rs:33:18
51    |
52 LL |     another_item.method();
53    |                  ^^^^^^ method not found in `RwLock<Struct<u32>>`
54    |
55 note: the method `method` exists on the type `Struct<u32>`
56   --> $DIR/inner_type.rs:9:5
57    |
58 LL |     pub fn method(&self) {}
59    |     ^^^^^^^^^^^^^^^^^^^^
60 help: use `.read().unwrap()` to borrow the `Struct<u32>`, blocking the current thread until it can be acquired
61    |
62 LL |     another_item.read().unwrap().method();
63    |                 ++++++++++++++++
64
65 error[E0599]: no method named `some_mutable_method` found for struct `RwLock` in the current scope
66   --> $DIR/inner_type.rs:37:18
67    |
68 LL |     another_item.some_mutable_method();
69    |                  ^^^^^^^^^^^^^^^^^^^ method not found in `RwLock<Struct<u32>>`
70    |
71 note: the method `some_mutable_method` exists on the type `Struct<u32>`
72   --> $DIR/inner_type.rs:11:5
73    |
74 LL |     pub fn some_mutable_method(&mut self) {}
75    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76 help: use `.write().unwrap()` to mutably borrow the `Struct<u32>`, blocking the current thread until it can be acquired
77    |
78 LL |     another_item.write().unwrap().some_mutable_method();
79    |                 +++++++++++++++++
80
81 error: aborting due to 5 previous errors
82
83 For more information about this error, try `rustc --explain E0599`.