Uh oh!
There was an error while loading. Please reload this page.
Use structured suggestion for restricting bounds - #65192
Conversation
rust-highfive
commented
Oct 7, 2019
(rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
As I noted on Discord, I think this method is way too complicated not be be divided along the important match arms (or the places that involve early returns) (and it doesn't fit on a single page...). However, if you insist on keeping it all in one method then let's at least use a .filter(...) here to reduce the drift rightwards.
Uh oh!
There was an error while loading. Please reload this page.
9dd6fa6 to
7409942Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
When a trait bound is not met and restricting a type parameter would make the restriction hold, use a structured suggestion pointing at an appropriate place (type param in param list or `where` clause). Account for opaque parameters where instead of suggesting extending the `where` clause, we suggest appending the new restriction: `fn foo(impl Trait + UnmetTrait)`.
estebank
commented
Oct 18, 2019
@matthewjasper all your comments have been addressed. |
matthewjasper
commented
Oct 19, 2019
@bors r+ |
bors
commented
Oct 19, 2019
📌 Commit c6dce78 has been approved by |
…asper Use structured suggestion for restricting bounds When a trait bound is not met and restricting a type parameter would make the restriction hold, use a structured suggestion pointing at an appropriate place (type param in param list or `where` clause). Account for opaque parameters where instead of suggesting extending the `where` clause, we suggest appending the new restriction: `fn foo(impl Trait + UnmetTrait)`. Fixrust-lang#64565, fixrust-lang#41817, fixrust-lang#24354, cc rust-lang#26026, cc rust-lang#37808, cc rust-lang#24159, fixrust-lang#37138, fixrust-lang#24354, cc rust-lang#20671.
…asper Use structured suggestion for restricting bounds When a trait bound is not met and restricting a type parameter would make the restriction hold, use a structured suggestion pointing at an appropriate place (type param in param list or `where` clause). Account for opaque parameters where instead of suggesting extending the `where` clause, we suggest appending the new restriction: `fn foo(impl Trait + UnmetTrait)`. Fixrust-lang#64565, fixrust-lang#41817, fixrust-lang#24354, cc rust-lang#26026, cc rust-lang#37808, cc rust-lang#24159, fixrust-lang#37138, fixrust-lang#24354, cc rust-lang#20671.
Rollup of 5 pull requests Successful merges: - #64007 (Add check for overlapping ranges to unreachable patterns lint) - #65192 (Use structured suggestion for restricting bounds) - #65226 (BTreeSet symmetric_difference & union optimized) - #65448 (rustc_codegen_ssa: remove some unnecessary Box special-casing.) - #65505 (Rc: value -> allocation) Failed merges: r? @ghost
When a trait bound is not met and restricting a type parameter would
make the restriction hold, use a structured suggestion pointing at an
appropriate place (type param in param list or
whereclause).Account for opaque parameters where instead of suggesting extending
the
whereclause, we suggest appending the new restriction:fn foo(impl Trait + UnmetTrait). Fix#64565, fix#41817, fix#24354,cc #26026, cc #37808, cc #24159, fix#37138, fix#24354, cc #20671.