Skip to content

Commit

Permalink
Rollup merge of rust-lang#81636 - LingMan:slice_not_vec, r=petrochenkov
Browse files Browse the repository at this point in the history
Directly use `Option<&[T]>` instead of converting from `Option<&Vec<T>>` later on

`@rustbot` modify labels +C-cleanup +T-compiler
  • Loading branch information
m-ou-se authored Feb 2, 2021
2 parents 7fa357d + b35d601 commit 2a41f20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_resolve/src/late/lifetimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2415,7 +2415,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
_ => break,
}
}
break Some(e);
break Some(&e[..]);
}
Elide::Forbid => break None,
};
Expand Down Expand Up @@ -2445,7 +2445,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
lifetime_refs.len(),
&lifetime_names,
lifetime_spans,
error.map(|p| &p[..]).unwrap_or(&[]),
error.unwrap_or(&[]),
);
err.emit();
}
Expand Down

0 comments on commit 2a41f20

Please sign in to comment.