rust/tests/ui/deriving/do-not-suggest-calling-fn-in-derive-macro.rs
Esteban Küber 8873c1871a Skip suggestions in derived code
Do not suggest

```
help: use parentheses to call these
  |
5 |     (callback: Rc<dyn Fn()>)(),
  |     +                      +++
```

Skip all "call function for this binop" suggestions when in a derive context.

Fix #135989.
2025-01-24 22:08:39 +00:00

9 lines
205 B
Rust

use std::rc::Rc;
#[derive(PartialEq)] //~ NOTE in this expansion
pub struct Function {
callback: Rc<dyn Fn()>, //~ ERROR binary operation `==` cannot be applied to type `Rc<dyn Fn()>`
}
fn main() {}