diff options
Diffstat (limited to 'compiler/rustc_ast_passes/src')
| -rw-r--r-- | compiler/rustc_ast_passes/src/ast_validation.rs | 23 | ||||
| -rw-r--r-- | compiler/rustc_ast_passes/src/errors.rs | 4 | 
2 files changed, 12 insertions, 15 deletions
| diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index 837cb805700..a9b65456b8c 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -562,10 +562,8 @@ impl<'a> AstValidator<'a> { FnHeader { safety: _, coroutine_kind, constness, ext }: FnHeader, ) { let report_err = |span| { - self.dcx().emit_err(errors::FnQualifierInExtern { - span: span, - block: self.current_extern_span(), - }); + self.dcx() + .emit_err(errors::FnQualifierInExtern { span, block: self.current_extern_span() }); }; match coroutine_kind { Some(knd) => report_err(knd.span()), @@ -963,14 +961,13 @@ impl<'a> Visitor<'a> for AstValidator<'a> { self_ty, items, }) => { - let error = - |annotation_span, annotation, only_trait: bool| errors::InherentImplCannot { - span: self_ty.span, - annotation_span, - annotation, - self_ty: self_ty.span, - only_trait: only_trait.then_some(()), - }; + let error = |annotation_span, annotation, only_trait| errors::InherentImplCannot { + span: self_ty.span, + annotation_span, + annotation, + self_ty: self_ty.span, + only_trait, + }; self.with_in_trait_impl(None, |this| { this.visibility_not_permitted( @@ -1195,7 +1192,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> { } else if where_clauses.after.has_where_token { self.dcx().emit_err(errors::WhereClauseAfterTypeAlias { span: where_clauses.after.span, - help: self.session.is_nightly_build().then_some(()), + help: self.session.is_nightly_build(), }); } } diff --git a/compiler/rustc_ast_passes/src/errors.rs b/compiler/rustc_ast_passes/src/errors.rs index 9e403680837..de1b3f55e80 100644 --- a/compiler/rustc_ast_passes/src/errors.rs +++ b/compiler/rustc_ast_passes/src/errors.rs @@ -484,7 +484,7 @@ pub struct InherentImplCannot<'a> { #[label(ast_passes_type)] pub self_ty: Span, #[note(ast_passes_only_trait)] - pub only_trait: Option<()>, + pub only_trait: bool, } #[derive(Diagnostic)] @@ -528,7 +528,7 @@ pub struct WhereClauseAfterTypeAlias { #[primary_span] pub span: Span, #[help] - pub help: Option<()>, + pub help: bool, } #[derive(Diagnostic)] | 
