Skip to content

Commit 65d8785

Browse files
committed
Auto merge of rust-lang#92377 - compiler-errors:rustdoc-lifetimes, r=camelid,jyn514
remove in_band_lifetimes from librustdoc r? `@camelid` closes rust-lang#92368
2 parents 1b3a5f2 + bc7968f commit 65d8785

File tree

9 files changed

+19
-20
lines changed

9 files changed

+19
-20
lines changed

src/librustdoc/clean/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ fn clean_trait_ref_with_bindings(
148148
path
149149
}
150150

151-
impl Clean<Path> for ty::TraitRef<'tcx> {
151+
impl Clean<Path> for ty::TraitRef<'_> {
152152
fn clean(&self, cx: &mut DocContext<'_>) -> Path {
153153
clean_trait_ref_with_bindings(cx, *self, &[])
154154
}
@@ -549,7 +549,7 @@ impl Clean<Generics> for hir::Generics<'_> {
549549
fn clean_ty_generics(
550550
cx: &mut DocContext<'_>,
551551
gens: &ty::Generics,
552-
preds: ty::GenericPredicates<'tcx>,
552+
preds: ty::GenericPredicates<'_>,
553553
) -> Generics {
554554
// Don't populate `cx.impl_trait_bounds` before `clean`ning `where` clauses,
555555
// since `Clean for ty::Predicate` would consume them.
@@ -579,7 +579,7 @@ fn clean_ty_generics(
579579
.collect::<Vec<GenericParamDef>>();
580580

581581
// param index -> [(DefId of trait, associated type name, type)]
582-
let mut impl_trait_proj = FxHashMap::<u32, Vec<(DefId, Symbol, Ty<'tcx>)>>::default();
582+
let mut impl_trait_proj = FxHashMap::<u32, Vec<(DefId, Symbol, Ty<'_>)>>::default();
583583

584584
let where_predicates = preds
585585
.predicates
@@ -708,8 +708,8 @@ fn clean_ty_generics(
708708

709709
fn clean_fn_or_proc_macro(
710710
item: &hir::Item<'_>,
711-
sig: &'a hir::FnSig<'a>,
712-
generics: &'a hir::Generics<'a>,
711+
sig: &hir::FnSig<'_>,
712+
generics: &hir::Generics<'_>,
713713
body_id: hir::BodyId,
714714
name: &mut Symbol,
715715
cx: &mut DocContext<'_>,
@@ -1387,7 +1387,7 @@ impl Clean<Type> for hir::Ty<'_> {
13871387
}
13881388

13891389
/// Returns `None` if the type could not be normalized
1390-
fn normalize(cx: &mut DocContext<'tcx>, ty: Ty<'_>) -> Option<Ty<'tcx>> {
1390+
fn normalize<'tcx>(cx: &mut DocContext<'tcx>, ty: Ty<'_>) -> Option<Ty<'tcx>> {
13911391
// HACK: low-churn fix for #79459 while we wait for a trait normalization fix
13921392
if !cx.tcx.sess.opts.debugging_opts.normalize_docs {
13931393
return None;

src/librustdoc/clean/utils.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ crate fn name_from_pat(p: &hir::Pat<'_>) -> Symbol {
223223
})
224224
}
225225

226-
crate fn print_const(cx: &DocContext<'_>, n: &'tcx ty::Const<'_>) -> String {
226+
crate fn print_const(cx: &DocContext<'_>, n: &ty::Const<'_>) -> String {
227227
match n.val {
228228
ty::ConstKind::Unevaluated(ty::Unevaluated { def, substs_: _, promoted }) => {
229229
let mut s = if let Some(def) = def.as_local() {
@@ -294,7 +294,7 @@ fn format_integer_with_underscore_sep(num: &str) -> String {
294294
.collect()
295295
}
296296

297-
fn print_const_with_custom_print_scalar(tcx: TyCtxt<'_>, ct: &'tcx ty::Const<'tcx>) -> String {
297+
fn print_const_with_custom_print_scalar(tcx: TyCtxt<'_>, ct: &ty::Const<'_>) -> String {
298298
// Use a slightly different format for integer types which always shows the actual value.
299299
// For all other types, fallback to the original `pretty_print_const`.
300300
match (ct.val, ct.ty.kind()) {
@@ -362,7 +362,7 @@ crate fn resolve_type(cx: &mut DocContext<'_>, path: Path) -> Type {
362362
}
363363

364364
crate fn get_auto_trait_and_blanket_impls(
365-
cx: &mut DocContext<'tcx>,
365+
cx: &mut DocContext<'_>,
366366
item_def_id: DefId,
367367
) -> impl Iterator<Item = Item> {
368368
let auto_impls = cx

src/librustdoc/html/highlight.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ struct TokenIter<'a> {
187187
src: &'a str,
188188
}
189189

190-
impl Iterator for TokenIter<'a> {
190+
impl<'a> Iterator for TokenIter<'a> {
191191
type Item = (TokenKind, &'a str);
192192
fn next(&mut self) -> Option<(TokenKind, &'a str)> {
193193
if self.src.is_empty() {
@@ -227,7 +227,7 @@ struct PeekIter<'a> {
227227
iter: TokenIter<'a>,
228228
}
229229

230-
impl PeekIter<'a> {
230+
impl<'a> PeekIter<'a> {
231231
fn new(iter: TokenIter<'a>) -> Self {
232232
Self { stored: VecDeque::new(), peek_pos: 0, iter }
233233
}
@@ -254,7 +254,7 @@ impl PeekIter<'a> {
254254
}
255255
}
256256

257-
impl Iterator for PeekIter<'a> {
257+
impl<'a> Iterator for PeekIter<'a> {
258258
type Item = (TokenKind, &'a str);
259259
fn next(&mut self) -> Option<Self::Item> {
260260
self.peek_pos = 0;

src/librustdoc/html/render/span_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<'tcx> SpanMapVisitor<'tcx> {
9292
}
9393
}
9494

95-
impl Visitor<'tcx> for SpanMapVisitor<'tcx> {
95+
impl<'tcx> Visitor<'tcx> for SpanMapVisitor<'tcx> {
9696
type Map = rustc_middle::hir::map::Map<'tcx>;
9797

9898
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {

src/librustdoc/html/sources.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl DocVisitor for SourceCollector<'_, '_> {
142142
}
143143
}
144144

145-
impl SourceCollector<'_, 'tcx> {
145+
impl SourceCollector<'_, '_> {
146146
/// Renders the given filename into its corresponding HTML source file.
147147
fn emit_source(
148148
&mut self,

src/librustdoc/json/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ crate struct JsonRenderer<'tcx> {
3737
cache: Rc<Cache>,
3838
}
3939

40-
impl JsonRenderer<'tcx> {
40+
impl<'tcx> JsonRenderer<'tcx> {
4141
fn sess(&self) -> &'tcx Session {
4242
self.tcx.sess
4343
}

src/librustdoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#![feature(box_patterns)]
99
#![feature(control_flow_enum)]
1010
#![feature(box_syntax)]
11-
#![feature(in_band_lifetimes)]
1211
#![feature(let_else)]
1312
#![feature(nll)]
1413
#![feature(test)]

src/librustdoc/passes/collect_intra_doc_links.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ enum MalformedGenerics {
210210
EmptyAngleBrackets,
211211
}
212212

213-
impl ResolutionFailure<'a> {
213+
impl ResolutionFailure<'_> {
214214
/// This resolved fully (not just partially) but is erroneous for some other reason
215215
///
216216
/// Returns the full resolution of the link, if present.
@@ -336,7 +336,7 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
336336
/// full path segments left in the link.
337337
///
338338
/// [enum struct variant]: hir::VariantData::Struct
339-
fn variant_field(
339+
fn variant_field<'path>(
340340
&self,
341341
path_str: &'path str,
342342
module_id: DefId,

src/librustdoc/visit_ast.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ crate struct Module<'hir> {
3232
crate foreigns: Vec<(&'hir hir::ForeignItem<'hir>, Option<Symbol>)>,
3333
}
3434

35-
impl Module<'hir> {
36-
crate fn new(name: Symbol, id: hir::HirId, where_inner: Span) -> Module<'hir> {
35+
impl Module<'_> {
36+
crate fn new(name: Symbol, id: hir::HirId, where_inner: Span) -> Self {
3737
Module { name, id, where_inner, mods: Vec::new(), items: Vec::new(), foreigns: Vec::new() }
3838
}
3939

0 commit comments

Comments
 (0)