]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_middle/src/mir/spanview.rs
Auto merge of #106976 - tmiasko:borrowck-lazy-dominators, r=cjgillot
[rust.git] / compiler / rustc_middle / src / mir / spanview.rs
index 4e06d91012c0dfc9c0f0eb50d1792357df25a2ef..887ee57157540e6f408de841d5825761978af356 100644 (file)
@@ -230,7 +230,7 @@ pub fn write_document<'tcx, W>(
 }
 
 /// Format a string showing the start line and column, and end line and column within a file.
-pub fn source_range_no_file<'tcx>(tcx: TyCtxt<'tcx>, span: Span) -> String {
+pub fn source_range_no_file(tcx: TyCtxt<'_>, span: Span) -> String {
     let source_map = tcx.sess.source_map();
     let start = source_map.lookup_char_pos(span.lo());
     let end = source_map.lookup_char_pos(span.hi());
@@ -322,7 +322,7 @@ fn block_span_viewable<'tcx>(
     Some(SpanViewable { bb, span, id, tooltip })
 }
 
-fn compute_block_span<'tcx>(data: &BasicBlockData<'tcx>, body_span: Span) -> Span {
+fn compute_block_span(data: &BasicBlockData<'_>, body_span: Span) -> Span {
     let mut span = data.terminator().source_info.span;
     for statement_span in data.statements.iter().map(|statement| statement.source_info.span) {
         // Only combine Spans from the root context, and within the function's body_span.
@@ -522,12 +522,7 @@ fn write_next_viewable_with_overlaps<'tcx, 'b, W>(
 }
 
 #[inline(always)]
-fn write_coverage_gap<'tcx, W>(
-    tcx: TyCtxt<'tcx>,
-    lo: BytePos,
-    hi: BytePos,
-    w: &mut W,
-) -> io::Result<()>
+fn write_coverage_gap<W>(tcx: TyCtxt<'_>, lo: BytePos, hi: BytePos, w: &mut W) -> io::Result<()>
 where
     W: Write,
 {
@@ -582,8 +577,8 @@ fn write_span<W>(
     Ok(())
 }
 
-fn make_html_snippet<'tcx>(
-    tcx: TyCtxt<'tcx>,
+fn make_html_snippet(
+    tcx: TyCtxt<'_>,
     span: Span,
     some_viewable: Option<&SpanViewable>,
 ) -> Option<String> {
@@ -664,7 +659,7 @@ fn trim_span_hi(span: Span, to_pos: BytePos) -> Span {
     if to_pos >= span.hi() { span } else { span.with_hi(cmp::max(span.lo(), to_pos)) }
 }
 
-fn fn_span<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> Span {
+fn fn_span(tcx: TyCtxt<'_>, def_id: DefId) -> Span {
     let fn_decl_span = tcx.def_span(def_id);
     if let Some(body_span) = hir_body(tcx, def_id).map(|hir_body| hir_body.value.span) {
         if fn_decl_span.eq_ctxt(body_span) { fn_decl_span.to(body_span) } else { body_span }
@@ -673,7 +668,7 @@ fn fn_span<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> Span {
     }
 }
 
-fn hir_body<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> Option<&'tcx rustc_hir::Body<'tcx>> {
+fn hir_body(tcx: TyCtxt<'_>, def_id: DefId) -> Option<&rustc_hir::Body<'_>> {
     let hir_node = tcx.hir().get_if_local(def_id).expect("expected DefId is local");
     hir::map::associated_body(hir_node).map(|fn_body_id| tcx.hir().body(fn_body_id))
 }