update two rustdoc comments

This commit is contained in:
Ellen 2022-02-14 11:27:30 +00:00
parent 5e0e7ff068
commit 48a79bcf7b

View File

@ -397,10 +397,10 @@ fn print_const_with_custom_print_scalar(tcx: TyCtxt<'_>, ct: &ty::Const<'_>) ->
| Union | Mod | ForeignTy | Const | Static | Macro(..) | TraitAlias),
i,
) => (i, kind.into()),
// This is part of a trait definition; document the trait.
// This is part of a trait definition or trait impl; document the trait.
Res::SelfTy { trait_: Some(trait_def_id), alias_to: _ } => (trait_def_id, ItemType::Trait),
// This is an inherent impl; it doesn't have its own page.
Res::SelfTy { trait_: None, alias_to: Some((impl_def_id, _)) } => return impl_def_id,
// This is an inherent impl or a type definition; it doesn't have its own page.
Res::SelfTy { trait_: None, alias_to: Some((item_def_id, _)) } => return item_def_id,
Res::SelfTy { trait_: None, alias_to: None }
| Res::PrimTy(_)
| Res::ToolMod