Skip to content

Commit

Permalink
review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Apr 18, 2020
1 parent 8272465 commit fe7216d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustc_resolve/late/lifetimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2387,6 +2387,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
let mut err = self.report_missing_lifetime_specifiers(span, lifetime_refs.len());

if let Some(params) = error {
// If there's no lifetime available, suggest `'static`.
if self.report_elision_failure(&mut err, params) && lifetime_names.is_empty() {
lifetime_names.insert(ast::Ident::from_str("'static"));
}
Expand All @@ -2405,7 +2406,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
&mut self,
db: &mut DiagnosticBuilder<'_>,
params: &[ElisionFailureInfo],
) -> bool {
) -> bool /* add `'static` lifetime to lifetime list */ {
let mut m = String::new();
let len = params.len();

Expand Down

0 comments on commit fe7216d

Please sign in to comment.