1 use rustc_macros::{SessionDiagnostic, SessionSubdiagnostic};
2 use rustc_span::{Span, Symbol};
4 #[derive(SessionDiagnostic)]
5 #[error(privacy::field_is_private, code = "E0451")]
6 pub struct FieldIsPrivate {
9 pub field_name: Symbol,
10 pub variant_descr: &'static str,
11 pub def_path_str: String,
13 pub label: FieldIsPrivateLabel,
16 #[derive(SessionSubdiagnostic)]
17 pub enum FieldIsPrivateLabel {
18 #[label(privacy::field_is_private_is_update_syntax_label)]
24 #[label(privacy::field_is_private_label)]
31 #[derive(SessionDiagnostic)]
32 #[error(privacy::item_is_private)]
33 pub struct ItemIsPrivate<'a> {
41 #[derive(SessionDiagnostic)]
42 #[error(privacy::unnamed_item_is_private)]
43 pub struct UnnamedItemIsPrivate {
46 pub kind: &'static str,