diff options
| author | Robin Schroer <git@sulami.xyz> | 2022-12-08 21:42:15 +0100 |
|---|---|---|
| committer | Robin Schroer <git@sulami.xyz> | 2022-12-09 12:15:51 +0100 |
| commit | 40ba1c902f0fa4f288242f573408f122c71945ce (patch) | |
| tree | c19d8902e35f50ba66b08173dd63bae44accc366 /src/test/rustdoc-ui/coverage/enum-tuple.rs | |
| parent | 7632db0e87d8adccc9a83a47795c9411b1455855 (diff) | |
| download | rust-40ba1c902f0fa4f288242f573408f122c71945ce.tar.gz rust-40ba1c902f0fa4f288242f573408f122c71945ce.zip | |
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.
Diffstat (limited to 'src/test/rustdoc-ui/coverage/enum-tuple.rs')
0 files changed, 0 insertions, 0 deletions
