Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is necessary to continue to compile in future Rust versions as this previously only compiled due to an underspecified part of the type system. It will stop compiling once rust-lang/rust#119820 lands.
The where bound
F: MakeWriter<'a>
is weaker than the required bound ofBunyanFormattingLayer
which requiresfor<'a> F: MakeWriter<'a>
, i.e.F
implementsMakeWriter<'a>
for all lifetimes'a
, not just the lifetime'a
used when calling the function. This bound does hold because of an implementation ofMakeWriter
for all types which implementFn() -> W
. However, we generally prefer where-bounds over impls when proving trait bounds, causing us to get a higher-ranked region error.This error was previously detected more eagerly, causing the compiler to discard this where-bound, proving the requirement by using the impl instead. This now stops being the case, causing your code to error.
Please ask for clarification if you would like further information. I apologize for the inconvenience.