Skip to content

remove in_band_lifetimes from librustdoc #92377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, &[])
}
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<'_>,
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/clean/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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()) {
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/html/highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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 }
}
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/render/span_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ crate struct JsonRenderer<'tcx> {
cache: Rc<Cache>,
}

impl JsonRenderer<'tcx> {
impl<'tcx> JsonRenderer<'tcx> {
fn sess(&self) -> &'tcx Session {
self.tcx.sess
}
Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -283,7 +283,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,
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/visit_ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() }
}

Expand Down