Skip to content

Commit ad379cd

Browse files
committed
review comment
1 parent 322b204 commit ad379cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_resolve/late/lifetimes.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2390,6 +2390,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
23902390
let mut err = self.report_missing_lifetime_specifiers(span, lifetime_refs.len());
23912391

23922392
if let Some(params) = error {
2393+
// If there's no lifetime available, suggest `'static`.
23932394
if self.report_elision_failure(&mut err, params) && lifetime_names.is_empty() {
23942395
lifetime_names.insert(ast::Ident::from_str("'static"));
23952396
}
@@ -2408,7 +2409,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
24082409
&mut self,
24092410
db: &mut DiagnosticBuilder<'_>,
24102411
params: &[ElisionFailureInfo],
2411-
) -> bool {
2412+
) -> bool /* add `'static` lifetime to lifetime list */ {
24122413
let mut m = String::new();
24132414
let len = params.len();
24142415

0 commit comments

Comments
 (0)