rust/src/test/ui/illegal-sized-bound
Robin Schroer 40ba1c902f
Illegal sized bounds: only suggest mutability change if needed
In a scenario like

```
struct Type;

pub trait Trait {
    fn function(&mut self)
    where
        Self: Sized;
}

impl Trait for Type {
    fn function(&mut self) {}
}

fn main() {
    (&mut Type as &mut dyn Trait).function();
}
```

the problem is Sized, not the mutability of self. Thus don't emit the
"you need &T instead of &mut T" note, or the other way around, as all
it does is just invert the mutability of whatever was supplied.

Fixes #103622.
2022-12-09 12:15:51 +01:00
..
mutability-mismatch.rs Illegal sized bounds: only suggest mutability change if needed 2022-12-09 12:15:51 +01:00
mutability-mismatch.stderr Illegal sized bounds: only suggest mutability change if needed 2022-12-09 12:15:51 +01:00
regular.rs Illegal sized bounds: only suggest mutability change if needed 2022-12-09 12:15:51 +01:00
regular.stderr Illegal sized bounds: only suggest mutability change if needed 2022-12-09 12:15:51 +01:00