2c14bc3b55
Use `impl`'s generics when suggesting fix on bad `impl Copy` See the UI test for a more complicated example, but we weren't correctly suggesting to add bounds given a manual `impl` whose generics didn't match the struct generics. ```rust #[derive(Clone)] struct Wrapper<T>(T); impl<S> Copy for Wrapper<S> {} ``` Coincidentally this fix didn't cause any regressions for `derive(Copy)` impls, I think because those use the same spans in the impl generics as the struct generics, so the machinery still applies the same change. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.