Auto merge of #92377 - compiler-errors:rustdoc-lifetimes, r=camelid,jyn514

remove in_band_lifetimes from librustdoc

r? `@camelid`

closes #92368
This commit is contained in:
bors 2021-12-30 08:26:07 +00:00
commit 65d8785f0a
9 changed files with 19 additions and 20 deletions

View file

@ -148,7 +148,7 @@ fn clean_trait_ref_with_bindings(
path
}
impl Clean<Path> for ty::TraitRef<'tcx> {
impl Clean<Path> for ty::TraitRef<'_> {
fn clean(&self, cx: &mut DocContext<'_>) -> Path {
clean_trait_ref_with_bindings(cx, *self, &[])
}
@ -549,7 +549,7 @@ impl Clean<Generics> for hir::Generics<'_> {
fn clean_ty_generics(
cx: &mut DocContext<'_>,
gens: &ty::Generics,
preds: ty::GenericPredicates<'tcx>,
preds: ty::GenericPredicates<'_>,
) -> Generics {
// Don't populate `cx.impl_trait_bounds` before `clean`ning `where` clauses,
// since `Clean for ty::Predicate` would consume them.
@ -579,7 +579,7 @@ fn clean_ty_generics(
.collect::<Vec<GenericParamDef>>();
// param index -> [(DefId of trait, associated type name, type)]
let mut impl_trait_proj = FxHashMap::<u32, Vec<(DefId, Symbol, Ty<'tcx>)>>::default();
let mut impl_trait_proj = FxHashMap::<u32, Vec<(DefId, Symbol, Ty<'_>)>>::default();
let where_predicates = preds
.predicates
@ -708,8 +708,8 @@ fn clean_ty_generics(
fn clean_fn_or_proc_macro(
item: &hir::Item<'_>,
sig: &'a hir::FnSig<'a>,
generics: &'a hir::Generics<'a>,
sig: &hir::FnSig<'_>,
generics: &hir::Generics<'_>,
body_id: hir::BodyId,
name: &mut Symbol,
cx: &mut DocContext<'_>,
@ -1387,7 +1387,7 @@ impl Clean<Type> for hir::Ty<'_> {
}
/// Returns `None` if the type could not be normalized
fn normalize(cx: &mut DocContext<'tcx>, ty: Ty<'_>) -> Option<Ty<'tcx>> {
fn normalize<'tcx>(cx: &mut DocContext<'tcx>, ty: Ty<'_>) -> Option<Ty<'tcx>> {
// HACK: low-churn fix for #79459 while we wait for a trait normalization fix
if !cx.tcx.sess.opts.debugging_opts.normalize_docs {
return None;

View file

@ -223,7 +223,7 @@ crate fn name_from_pat(p: &hir::Pat<'_>) -> Symbol {
})
}
crate fn print_const(cx: &DocContext<'_>, n: &'tcx ty::Const<'_>) -> String {
crate fn print_const(cx: &DocContext<'_>, n: &ty::Const<'_>) -> String {
match n.val {
ty::ConstKind::Unevaluated(ty::Unevaluated { def, substs_: _, promoted }) => {
let mut s = if let Some(def) = def.as_local() {
@ -294,7 +294,7 @@ fn format_integer_with_underscore_sep(num: &str) -> String {
.collect()
}
fn print_const_with_custom_print_scalar(tcx: TyCtxt<'_>, ct: &'tcx ty::Const<'tcx>) -> String {
fn print_const_with_custom_print_scalar(tcx: TyCtxt<'_>, ct: &ty::Const<'_>) -> String {
// Use a slightly different format for integer types which always shows the actual value.
// For all other types, fallback to the original `pretty_print_const`.
match (ct.val, ct.ty.kind()) {
@ -362,7 +362,7 @@ crate fn resolve_type(cx: &mut DocContext<'_>, path: Path) -> Type {
}
crate fn get_auto_trait_and_blanket_impls(
cx: &mut DocContext<'tcx>,
cx: &mut DocContext<'_>,
item_def_id: DefId,
) -> impl Iterator<Item = Item> {
let auto_impls = cx

View file

@ -187,7 +187,7 @@ struct TokenIter<'a> {
src: &'a str,
}
impl Iterator for TokenIter<'a> {
impl<'a> Iterator for TokenIter<'a> {
type Item = (TokenKind, &'a str);
fn next(&mut self) -> Option<(TokenKind, &'a str)> {
if self.src.is_empty() {
@ -227,7 +227,7 @@ struct PeekIter<'a> {
iter: TokenIter<'a>,
}
impl PeekIter<'a> {
impl<'a> PeekIter<'a> {
fn new(iter: TokenIter<'a>) -> Self {
Self { stored: VecDeque::new(), peek_pos: 0, iter }
}
@ -254,7 +254,7 @@ impl PeekIter<'a> {
}
}
impl Iterator for PeekIter<'a> {
impl<'a> Iterator for PeekIter<'a> {
type Item = (TokenKind, &'a str);
fn next(&mut self) -> Option<Self::Item> {
self.peek_pos = 0;

View file

@ -92,7 +92,7 @@ impl<'tcx> SpanMapVisitor<'tcx> {
}
}
impl Visitor<'tcx> for SpanMapVisitor<'tcx> {
impl<'tcx> Visitor<'tcx> for SpanMapVisitor<'tcx> {
type Map = rustc_middle::hir::map::Map<'tcx>;
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {

View file

@ -142,7 +142,7 @@ impl DocVisitor for SourceCollector<'_, '_> {
}
}
impl SourceCollector<'_, 'tcx> {
impl SourceCollector<'_, '_> {
/// Renders the given filename into its corresponding HTML source file.
fn emit_source(
&mut self,

View file

@ -37,7 +37,7 @@ crate struct JsonRenderer<'tcx> {
cache: Rc<Cache>,
}
impl JsonRenderer<'tcx> {
impl<'tcx> JsonRenderer<'tcx> {
fn sess(&self) -> &'tcx Session {
self.tcx.sess
}

View file

@ -8,7 +8,6 @@
#![feature(box_patterns)]
#![feature(control_flow_enum)]
#![feature(box_syntax)]
#![feature(in_band_lifetimes)]
#![feature(let_else)]
#![feature(nll)]
#![feature(test)]

View file

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

View file

@ -32,8 +32,8 @@ crate struct Module<'hir> {
crate foreigns: Vec<(&'hir hir::ForeignItem<'hir>, Option<Symbol>)>,
}
impl Module<'hir> {
crate fn new(name: Symbol, id: hir::HirId, where_inner: Span) -> Module<'hir> {
impl Module<'_> {
crate fn new(name: Symbol, id: hir::HirId, where_inner: Span) -> Self {
Module { name, id, where_inner, mods: Vec::new(), items: Vec::new(), foreigns: Vec::new() }
}