diff options
| author | David Wood <david.wood@huawei.com> | 2022-06-22 14:11:39 +0100 |
|---|---|---|
| committer | David Wood <david.wood@huawei.com> | 2022-06-27 08:53:42 +0100 |
| commit | 74f3a965f44c69d2975f9d1206160d8001ac4e70 (patch) | |
| tree | e2a5e647ef7ad33b64d866ac1f4b185d3afbeb06 /compiler/rustc_privacy/src/errors.rs | |
| parent | 0557d02a9dcca2d0f2e3c6a5a0a69935da4cf1f5 (diff) | |
| download | rust-74f3a965f44c69d2975f9d1206160d8001ac4e70.tar.gz rust-74f3a965f44c69d2975f9d1206160d8001ac4e70.zip | |
privacy: port "in public interface" diag
Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_privacy/src/errors.rs')
| -rw-r--r-- | compiler/rustc_privacy/src/errors.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/compiler/rustc_privacy/src/errors.rs b/compiler/rustc_privacy/src/errors.rs index 4db712ac8ad..482721d373a 100644 --- a/compiler/rustc_privacy/src/errors.rs +++ b/compiler/rustc_privacy/src/errors.rs @@ -45,3 +45,31 @@ pub struct UnnamedItemIsPrivate { pub span: Span, pub kind: &'static str, } + +// Duplicate of `InPublicInterface` but with a different error code, shares the same slug. +#[derive(SessionDiagnostic)] +#[error(privacy::in_public_interface, code = "E0445")] +pub struct InPublicInterfaceTraits<'a> { + #[primary_span] + #[label] + pub span: Span, + pub vis_descr: &'static str, + pub kind: &'a str, + pub descr: String, + #[label(privacy::visibility_label)] + pub vis_span: Span, +} + +// Duplicate of `InPublicInterfaceTraits` but with a different error code, shares the same slug. +#[derive(SessionDiagnostic)] +#[error(privacy::in_public_interface, code = "E0446")] +pub struct InPublicInterface<'a> { + #[primary_span] + #[label] + pub span: Span, + pub vis_descr: &'static str, + pub kind: &'a str, + pub descr: String, + #[label(privacy::visibility_label)] + pub vis_span: Span, +} |
