Where bounds are ignored as part of trait type parameters on an impl #60374
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Where bounds are ignored, but suggested by the compiler, when implementing trait objects with second order types.
A full example is available at: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d61ff8acea97a202e00ea6fc32def211
The bound on line 21 is ignored:
but suggested (with inaccurate markers):
In fact, in the example given, the error is repeated four times for good measure, in a standard
cargo build
.The workaround is to add another type parameter to the function declaration - i.e. changing:
to
which additionally requires duplicating any bounds on the inner type (i.e,
specified at https://docs.rs/hyper/0.12.25/src/hyper/service/make_service.rs.html#10-44).
This results in function declarations with large numbers of type parameters, and more complex bounds than is strictly necessary.
The text was updated successfully, but these errors were encountered: