diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-14 10:31:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-14 10:31:05 +0100 |
| commit | 49b99078b0ea08e37ed006e10f3e0705c63c4560 (patch) | |
| tree | 81d90838867a75298ef1c6cdd58cf99e75e1a703 /library/std/src/sys/unix/stack_overflow.rs | |
| parent | 8ed0384ca4651e914793dd8a05c9cdec9b2089b4 (diff) | |
| parent | 40ba1c902f0fa4f288242f573408f122c71945ce (diff) | |
| download | rust-49b99078b0ea08e37ed006e10f3e0705c63c4560.tar.gz rust-49b99078b0ea08e37ed006e10f3e0705c63c4560.zip | |
Rollup merge of #105491 - sulami:master, r=compiler-errors
Illegal sized bounds: only suggest mutability change if needed
In a scenario like
```rust
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 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
