Skip to content

Commit 53ce927

Browse files
committed
Fix elided_named_lifetimes in code
1 parent f167efa commit 53ce927

File tree

14 files changed

+18
-15
lines changed

14 files changed

+18
-15
lines changed

Diff for: compiler/rustc_codegen_ssa/src/back/archive.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub trait ArchiveBuilderBuilder {
125125
rlib: &'a Path,
126126
outdir: &Path,
127127
bundled_lib_file_names: &FxIndexSet<Symbol>,
128-
) -> Result<(), ExtractBundledLibsError<'_>> {
128+
) -> Result<(), ExtractBundledLibsError<'a>> {
129129
let archive_map = unsafe {
130130
Mmap::map(
131131
File::open(rlib)

Diff for: compiler/rustc_errors/src/markdown/parse.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub fn entrypoint(txt: &str) -> MdStream<'_> {
8080
}
8181

8282
/// Parse a buffer with specified context
83-
fn parse_recursive<'a>(buf: &'a [u8], ctx: Context) -> MdStream<'_> {
83+
fn parse_recursive<'a>(buf: &'a [u8], ctx: Context) -> MdStream<'a> {
8484
use ParseOpt as Po;
8585
use Prev::{Escape, Newline, Whitespace};
8686

Diff for: compiler/rustc_errors/src/translation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub trait Translate {
5959
&'a self,
6060
message: &'a DiagMessage,
6161
args: &'a FluentArgs<'_>,
62-
) -> Result<Cow<'_, str>, TranslateError<'_>> {
62+
) -> Result<Cow<'a, str>, TranslateError<'a>> {
6363
trace!(?message, ?args);
6464
let (identifier, attr) = match message {
6565
DiagMessage::Str(msg) | DiagMessage::Translated(msg) => {

Diff for: compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ pub(super) fn find_opaque_ty_constraints_for_rpit<'tcx>(
331331
tcx: TyCtxt<'tcx>,
332332
def_id: LocalDefId,
333333
owner_def_id: LocalDefId,
334-
) -> Ty<'_> {
334+
) -> Ty<'tcx> {
335335
let tables = tcx.typeck(owner_def_id);
336336

337337
// Check that all of the opaques we inferred during HIR are compatible.

Diff for: compiler/rustc_hir_typeck/src/coercion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ fn identity(_: Ty<'_>) -> Vec<Adjustment<'_>> {
106106
vec![]
107107
}
108108

109-
fn simple<'tcx>(kind: Adjust<'tcx>) -> impl FnOnce(Ty<'tcx>) -> Vec<Adjustment<'_>> {
109+
fn simple<'tcx>(kind: Adjust<'tcx>) -> impl FnOnce(Ty<'tcx>) -> Vec<Adjustment<'tcx>> {
110110
move |target| vec![Adjustment { kind, target }]
111111
}
112112

Diff for: compiler/rustc_hir_typeck/src/lib.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,17 @@ fn used_trait_imports(tcx: TyCtxt<'_>, def_id: LocalDefId) -> &UnordSet<LocalDef
8787
&tcx.typeck(def_id).used_trait_imports
8888
}
8989

90-
fn typeck<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &ty::TypeckResults<'tcx> {
90+
fn typeck<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> {
9191
let fallback = move || tcx.type_of(def_id.to_def_id()).instantiate_identity();
9292
typeck_with_fallback(tcx, def_id, fallback, None)
9393
}
9494

9595
/// Used only to get `TypeckResults` for type inference during error recovery.
9696
/// Currently only used for type inference of `static`s and `const`s to avoid type cycle errors.
97-
fn diagnostic_only_typeck<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &ty::TypeckResults<'tcx> {
97+
fn diagnostic_only_typeck<'tcx>(
98+
tcx: TyCtxt<'tcx>,
99+
def_id: LocalDefId,
100+
) -> &'tcx ty::TypeckResults<'tcx> {
98101
let fallback = move || {
99102
let span = tcx.hir().span(tcx.local_def_id_to_hir_id(def_id));
100103
Ty::new_error_with_message(tcx, span, "diagnostic only typeck table used")

Diff for: compiler/rustc_interface/src/queries.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl<'tcx> Queries<'tcx> {
9898
self.parse.compute(|| passes::parse(&self.compiler.sess))
9999
}
100100

101-
pub fn global_ctxt(&'tcx self) -> Result<QueryResult<'_, &'tcx GlobalCtxt<'tcx>>> {
101+
pub fn global_ctxt(&'tcx self) -> Result<QueryResult<'tcx, &'tcx GlobalCtxt<'tcx>>> {
102102
self.gcx.compute(|| {
103103
let krate = self.parse()?.steal();
104104

Diff for: compiler/rustc_metadata/src/rmeta/decoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
14871487
.decode((self, sess))
14881488
}
14891489

1490-
fn get_foreign_modules(self, sess: &'a Session) -> impl Iterator<Item = ForeignModule> + '_ {
1490+
fn get_foreign_modules(self, sess: &'a Session) -> impl Iterator<Item = ForeignModule> + 'a {
14911491
self.root.foreign_modules.decode((self, sess))
14921492
}
14931493

Diff for: compiler/rustc_middle/src/ty/generics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ impl<'tcx> Generics {
269269
}
270270

271271
/// Returns the `GenericParamDef` associated with this `ParamConst`.
272-
pub fn const_param(&'tcx self, param: ParamConst, tcx: TyCtxt<'tcx>) -> &GenericParamDef {
272+
pub fn const_param(&'tcx self, param: ParamConst, tcx: TyCtxt<'tcx>) -> &'tcx GenericParamDef {
273273
let param = self.param_at(param.index as usize, tcx);
274274
match param.kind {
275275
GenericParamDefKind::Const { .. } => param,

Diff for: compiler/rustc_mir_build/src/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ pub(crate) struct NonExhaustivePatternsTypeNotEmpty<'p, 'tcx, 'm> {
493493
}
494494

495495
impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for NonExhaustivePatternsTypeNotEmpty<'_, '_, '_> {
496-
fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'_, G> {
496+
fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
497497
let mut diag =
498498
Diag::new(dcx, level, fluent::mir_build_non_exhaustive_patterns_type_not_empty);
499499
diag.span(self.scrut_span);

Diff for: compiler/rustc_ty_utils/src/needs_drop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ fn adt_consider_insignificant_dtor<'tcx>(
366366
fn adt_drop_tys<'tcx>(
367367
tcx: TyCtxt<'tcx>,
368368
def_id: DefId,
369-
) -> Result<&ty::List<Ty<'tcx>>, AlwaysRequiresDrop> {
369+
) -> Result<&'tcx ty::List<Ty<'tcx>>, AlwaysRequiresDrop> {
370370
// This is for the "adt_drop_tys" query, that considers all `Drop` impls, therefore all dtors are
371371
// significant.
372372
let adt_has_dtor =

Diff for: src/librustdoc/passes/collect_intra_doc_links.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn filter_assoc_items_by_name_and_namespace<'a>(
5353
assoc_items_of: DefId,
5454
ident: Ident,
5555
ns: Namespace,
56-
) -> impl Iterator<Item = &ty::AssocItem> + 'a {
56+
) -> impl Iterator<Item = &'a ty::AssocItem> + 'a {
5757
tcx.associated_items(assoc_items_of).filter_by_name_unhygienic(ident.name).filter(move |item| {
5858
item.kind.namespace() == ns && tcx.hygienic_eq(ident, item.ident(tcx), assoc_items_of)
5959
})

Diff for: src/tools/clippy/clippy_lints/src/unused_io_amount.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ fn unpack_match<'a>(mut expr: &'a hir::Expr<'a>) -> &'a hir::Expr<'a> {
235235

236236
/// If `expr` is an (e).await, return the inner expression "e" that's being
237237
/// waited on. Otherwise return None.
238-
fn unpack_await<'a>(expr: &'a hir::Expr<'a>) -> &hir::Expr<'a> {
238+
fn unpack_await<'a>(expr: &'a hir::Expr<'a>) -> &'a hir::Expr<'a> {
239239
if let ExprKind::Match(expr, _, hir::MatchSource::AwaitDesugar) = expr.kind {
240240
if let ExprKind::Call(func, [ref arg_0, ..]) = expr.kind {
241241
if matches!(

Diff for: src/tools/miri/src/concurrency/thread.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
11571157
}
11581158

11591159
#[inline]
1160-
fn get_thread_name<'c>(&'c self, thread: ThreadId) -> Option<&[u8]>
1160+
fn get_thread_name<'c>(&'c self, thread: ThreadId) -> Option<&'c [u8]>
11611161
where
11621162
'tcx: 'c,
11631163
{

0 commit comments

Comments
 (0)