diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2020-07-10 18:07:31 -0400 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2020-07-15 10:54:05 -0400 |
| commit | 0759a55feff2d7c4a15b563adc087ac4f59acb1b (patch) | |
| tree | ec604cbacf0fc406864c411c4aac11355a201724 | |
| parent | 763d373dabb7ccf581737749a2a1adec335d8249 (diff) | |
| download | rust-0759a55feff2d7c4a15b563adc087ac4f59acb1b.tar.gz rust-0759a55feff2d7c4a15b563adc087ac4f59acb1b.zip | |
Remove unnecessary lifetime parameter
TyCtxt is a reference type and so can be passed by value.
| -rw-r--r-- | src/librustdoc/core.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index b87d7b19dcd..39c214b1fb4 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -392,7 +392,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt let hir = tcx.hir(); let body = hir.body(hir.body_owned_by(hir.as_local_hir_id(def_id))); debug!("visiting body for {:?}", def_id); - EmitIgnoredResolutionErrors::new(&tcx).visit_body(body); + EmitIgnoredResolutionErrors::new(tcx).visit_body(body); DEFAULT_TYPECK.with(|typeck| typeck(tcx, def_id)) }; }), @@ -602,17 +602,17 @@ thread_local!(static DEFAULT_TYPECK: for<'tcx> fn(TyCtxt<'tcx>, LocalDefId) -> & /// the name resolution pass may find errors that are never emitted. /// If typeck is called after this happens, then we'll get an ICE: /// 'Res::Error found but not reported'. To avoid this, emit the errors now. -struct EmitIgnoredResolutionErrors<'a, 'tcx> { - tcx: &'a TyCtxt<'tcx>, +struct EmitIgnoredResolutionErrors<'tcx> { + tcx: TyCtxt<'tcx>, } -impl<'a, 'tcx> EmitIgnoredResolutionErrors<'a, 'tcx> { - fn new(tcx: &'a TyCtxt<'tcx>) -> Self { +impl<'tcx> EmitIgnoredResolutionErrors<'tcx> { + fn new(tcx: TyCtxt<'tcx>) -> Self { Self { tcx } } } -impl<'tcx> Visitor<'tcx> for EmitIgnoredResolutionErrors<'_, 'tcx> { +impl<'tcx> Visitor<'tcx> for EmitIgnoredResolutionErrors<'tcx> { type Map = Map<'tcx>; fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> { |
