summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/shadowed-lplace-method.stderr
blob: 91d0d1200d4362bd3ddae84fd9c8d2b2a3d657b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
error[E0308]: mismatched types
  --> $DIR/shadowed-lplace-method.rs:9:24
   |
LL |     *rc.borrow_mut() = false;
   |     ----------------   ^^^^^ expected struct `Rc`, found `bool`
   |     |
   |     expected due to the type of this binding
   |
   = note: expected struct `Rc<RefCell<bool>>`
                found type `bool`
note: the `borrow_mut` call is resolved to the method in `std::borrow::BorrowMut`, shadowing the method of the same name on the inherent impl for `std::cell::RefCell<T>`
  --> $DIR/shadowed-lplace-method.rs:9:9
   |
LL | use std::borrow::BorrowMut;
   |     ---------------------- `std::borrow::BorrowMut` imported here
...
LL |     *rc.borrow_mut() = false;
   |         ^^^^^^^^^^ refers to `std::borrow::BorrowMut::borrow_mut`
help: you might have meant to call the other method; you can use the fully-qualified path to call it explicitly
   |
LL |     *std::cell::RefCell::<_>::borrow_mut(&rc) = false;
   |      +++++++++++++++++++++++++++++++++++++  ~

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.