]> git.lizzy.rs Git - rust.git/blob - tests/ui/methods/field-method-suggestion-using-return-ty.rs
Auto merge of #106646 - Amanieu:ilp32-object, r=Mark-Simulacrum
[rust.git] / tests / ui / methods / field-method-suggestion-using-return-ty.rs
1 struct Wrapper<T>(T);
2
3 impl Wrapper<Option<i32>> {
4     fn inner_mut(&self) -> Option<&mut i32> {
5         self.as_mut()
6         //~^ ERROR no method named `as_mut` found for reference `&Wrapper<Option<i32>>` in the current scope
7         //~| HELP one of the expressions' fields has a method of the same name
8         //~| HELP items from traits can only be used if
9     }
10
11     fn inner_mut_bad(&self) -> Option<&mut u32> {
12         self.as_mut()
13         //~^ ERROR no method named `as_mut` found for reference `&Wrapper<Option<i32>>` in the current scope
14         //~| HELP items from traits can only be used if
15     }
16 }
17
18 fn main() {}