1
Fork 0

Rollup merge of #102592 - WaffleLapkin:less_lifetimes, r=cjgillot

Remove a couple lifetimes that can be infered

From the review: https://github.com/rust-lang/rust/pull/101986#discussion_r974497497

r? `@cjgillot`
This commit is contained in:
Matthias Krüger 2022-10-03 08:00:48 +02:00 committed by GitHub
commit d5fb8d2aef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -274,29 +274,28 @@ pub fn explain_lint_level_source(
}
}
pub fn struct_lint_level<'s, 'd>(
sess: &'s Session,
pub fn struct_lint_level(
sess: &Session,
lint: &'static Lint,
level: Level,
src: LintLevelSource,
span: Option<MultiSpan>,
msg: impl Into<DiagnosticMessage>,
decorate: impl 'd
+ for<'a, 'b> FnOnce(
decorate: impl for<'a, 'b> FnOnce(
&'b mut DiagnosticBuilder<'a, ()>,
) -> &'b mut DiagnosticBuilder<'a, ()>,
) {
// Avoid codegen bloat from monomorphization by immediately doing dyn dispatch of `decorate` to
// the "real" work.
fn struct_lint_level_impl<'s, 'd>(
sess: &'s Session,
fn struct_lint_level_impl(
sess: &Session,
lint: &'static Lint,
level: Level,
src: LintLevelSource,
span: Option<MultiSpan>,
msg: impl Into<DiagnosticMessage>,
decorate: Box<
dyn 'd
dyn '_
+ for<'a, 'b> FnOnce(
&'b mut DiagnosticBuilder<'a, ()>,
) -> &'b mut DiagnosticBuilder<'a, ()>,