1
Fork 0

Formatting.

This commit is contained in:
Camille GILLOT 2020-11-26 19:11:43 +01:00
parent 51d10249e7
commit 60c3bbd844
7 changed files with 14 additions and 10 deletions

View file

@ -29,7 +29,7 @@ macro_rules! arena_types {
[] field_pat: rustc_hir::FieldPat<$tcx>, [] field_pat: rustc_hir::FieldPat<$tcx>,
[] fn_decl: rustc_hir::FnDecl<$tcx>, [] fn_decl: rustc_hir::FnDecl<$tcx>,
[] foreign_item: rustc_hir::ForeignItem<$tcx>, [] foreign_item: rustc_hir::ForeignItem<$tcx>,
[] foreign_item_ref: rustc_hir::ForeignItemRef<$tcx>, [few] foreign_item_ref: rustc_hir::ForeignItemRef<$tcx>,
[] impl_item_ref: rustc_hir::ImplItemRef<$tcx>, [] impl_item_ref: rustc_hir::ImplItemRef<$tcx>,
[few] inline_asm: rustc_hir::InlineAsm<$tcx>, [few] inline_asm: rustc_hir::InlineAsm<$tcx>,
[few] llvm_inline_asm: rustc_hir::LlvmInlineAsm<$tcx>, [few] llvm_inline_asm: rustc_hir::LlvmInlineAsm<$tcx>,

View file

@ -1855,7 +1855,7 @@ pub struct FnSig<'hir> {
} }
// The bodies for items are stored "out of line", in a separate // The bodies for items are stored "out of line", in a separate
// hashmap in the `Crate`. Here we just record the node-id of the item // hashmap in the `Crate`. Here we just record the hir-id of the item
// so it can fetched later. // so it can fetched later.
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Encodable, Debug)] #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Encodable, Debug)]
pub struct TraitItemId { pub struct TraitItemId {
@ -1899,7 +1899,7 @@ pub enum TraitItemKind<'hir> {
} }
// The bodies for items are stored "out of line", in a separate // The bodies for items are stored "out of line", in a separate
// hashmap in the `Crate`. Here we just record the node-id of the item // hashmap in the `Crate`. Here we just record the hir-id of the item
// so it can fetched later. // so it can fetched later.
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Encodable, Debug)] #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Encodable, Debug)]
pub struct ImplItemId { pub struct ImplItemId {
@ -2441,7 +2441,7 @@ impl VariantData<'hir> {
} }
// The bodies for items are stored "out of line", in a separate // The bodies for items are stored "out of line", in a separate
// hashmap in the `Crate`. Here we just record the node-id of the item // hashmap in the `Crate`. Here we just record the hir-id of the item
// so it can fetched later. // so it can fetched later.
#[derive(Copy, Clone, Encodable, Debug)] #[derive(Copy, Clone, Encodable, Debug)]
pub struct ItemId { pub struct ItemId {
@ -2624,7 +2624,7 @@ pub enum AssocItemKind {
} }
// The bodies for items are stored "out of line", in a separate // The bodies for items are stored "out of line", in a separate
// hashmap in the `Crate`. Here we just record the node-id of the item // hashmap in the `Crate`. Here we just record the hir-id of the item
// so it can fetched later. // so it can fetched later.
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Encodable, Debug)] #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Encodable, Debug)]
pub struct ForeignItemId { pub struct ForeignItemId {

View file

@ -289,7 +289,7 @@ pub trait Visitor<'v>: Sized {
walk_list!(self, visit_impl_item, opt_item); walk_list!(self, visit_impl_item, opt_item);
} }
/// Like `visit_nested_item()`, but for impl items. See /// Like `visit_nested_item()`, but for foreign items. See
/// `visit_nested_item()` for advice on when to override this /// `visit_nested_item()` for advice on when to override this
/// method. /// method.
fn visit_nested_foreign_item(&mut self, id: ForeignItemId) { fn visit_nested_foreign_item(&mut self, id: ForeignItemId) {

View file

@ -1225,7 +1225,7 @@ impl EncodeContext<'a, 'tcx> {
hir::ItemKind::Mod(ref m) => { hir::ItemKind::Mod(ref m) => {
return self.encode_info_for_mod(item.hir_id, m, &item.attrs); return self.encode_info_for_mod(item.hir_id, m, &item.attrs);
} }
hir::ItemKind::ForeignMod{..} => EntryKind::ForeignMod, hir::ItemKind::ForeignMod { .. } => EntryKind::ForeignMod,
hir::ItemKind::GlobalAsm(..) => EntryKind::GlobalAsm, hir::ItemKind::GlobalAsm(..) => EntryKind::GlobalAsm,
hir::ItemKind::TyAlias(..) => EntryKind::Type, hir::ItemKind::TyAlias(..) => EntryKind::Type,
hir::ItemKind::OpaqueTy(..) => { hir::ItemKind::OpaqueTy(..) => {

View file

@ -46,7 +46,9 @@ impl<'a, 'tcx> ItemLikeVisitor<'tcx> for EntryContext<'a, 'tcx> {
// Entry fn is never a trait item. // Entry fn is never a trait item.
} }
fn visit_foreign_item(&mut self, _: &'tcx ForeignItem<'tcx>) {} fn visit_foreign_item(&mut self, _: &'tcx ForeignItem<'tcx>) {
// Entry fn is never a foreign item.
}
} }
fn entry_fn(tcx: TyCtxt<'_>, cnum: CrateNum) -> Option<(LocalDefId, EntryFnType)> { fn entry_fn(tcx: TyCtxt<'_>, cnum: CrateNum) -> Option<(LocalDefId, EntryFnType)> {

View file

@ -379,7 +379,9 @@ impl<'a, 'tcx> ItemLikeVisitor<'tcx> for CollectPrivateImplItemsVisitor<'a, 'tcx
// processed in visit_item above // processed in visit_item above
} }
fn visit_foreign_item(&mut self, _foreign_item: &hir::ForeignItem<'_>) {} fn visit_foreign_item(&mut self, _foreign_item: &hir::ForeignItem<'_>) {
// We never export foreign functions as they have no body to export.
}
} }
fn reachable_set<'tcx>(tcx: TyCtxt<'tcx>, crate_num: CrateNum) -> FxHashSet<LocalDefId> { fn reachable_set<'tcx>(tcx: TyCtxt<'tcx>, crate_num: CrateNum) -> FxHashSet<LocalDefId> {

View file

@ -499,7 +499,7 @@ impl<'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'tcx> {
// optional. They inherit stability from their parents when unannotated. // optional. They inherit stability from their parents when unannotated.
if !matches!( if !matches!(
i.kind, i.kind,
hir::ItemKind::Impl { of_trait: None, .. } | hir::ItemKind::ForeignMod{..} hir::ItemKind::Impl { of_trait: None, .. } | hir::ItemKind::ForeignMod { .. }
) { ) {
self.check_missing_stability(i.hir_id, i.span); self.check_missing_stability(i.hir_id, i.span);
} }