diff options
| author | Xiretza <xiretza@xiretza.xyz> | 2022-09-01 19:29:23 +0200 |
|---|---|---|
| committer | Xiretza <xiretza@xiretza.xyz> | 2022-09-27 20:29:18 +0200 |
| commit | e1b1d7b029f8a8e6bade71cb03ae59b364745c31 (patch) | |
| tree | d406954b95d670efe0ba4c7d01b4c68b90e5ebcf /compiler/rustc_parse/src/parser/diagnostics.rs | |
| parent | e56d6a68dbda754b414abff41517f3fad9e547b0 (diff) | |
| download | rust-e1b1d7b029f8a8e6bade71cb03ae59b364745c31.tar.gz rust-e1b1d7b029f8a8e6bade71cb03ae59b364745c31.zip | |
Migrate more rustc_parse diagnostics to diagnostic structs
Diffstat (limited to 'compiler/rustc_parse/src/parser/diagnostics.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index 0fdde291757..326b2553eaf 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -55,34 +55,6 @@ pub(super) fn dummy_arg(ident: Ident) -> Param { } } -pub enum Error { - UselessDocComment, -} - -impl Error { - fn span_err( - self, - sp: impl Into<MultiSpan>, - handler: &Handler, - ) -> DiagnosticBuilder<'_, ErrorGuaranteed> { - match self { - Error::UselessDocComment => { - let mut err = struct_span_err!( - handler, - sp, - E0585, - "found a documentation comment that doesn't document anything", - ); - err.help( - "doc comments must come before what they document, maybe a comment was \ - intended with `//`?", - ); - err - } - } - } -} - pub(super) trait RecoverQPath: Sized + 'static { const PATH_STYLE: PathStyle = PathStyle::Expr; fn to_ty(&self) -> Option<P<Ty>>; @@ -269,15 +241,6 @@ impl<'a> DerefMut for SnapshotParser<'a> { impl<'a> Parser<'a> { #[rustc_lint_diagnostics] - pub(super) fn span_err<S: Into<MultiSpan>>( - &self, - sp: S, - err: Error, - ) -> DiagnosticBuilder<'a, ErrorGuaranteed> { - err.span_err(sp, self.diagnostic()) - } - - #[rustc_lint_diagnostics] pub fn struct_span_err<S: Into<MultiSpan>>( &self, sp: S, |
