diff options
| author | Michael Goulet <michael@errs.io> | 2024-08-21 00:57:58 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-08-21 01:31:11 -0400 |
| commit | 25ff9b6bcbba9e7831eb4d6eba2df6bbcd267c55 (patch) | |
| tree | 7c081b337e865ac7a20217d90e29a14ce63dcef0 /compiler/rustc_ast_passes/src/ast_validation.rs | |
| parent | 4d5b3b196284aded6ae99d12bcf149ffdc8ef379 (diff) | |
| download | rust-25ff9b6bcbba9e7831eb4d6eba2df6bbcd267c55.tar.gz rust-25ff9b6bcbba9e7831eb4d6eba2df6bbcd267c55.zip | |
Use bool in favor of Option<()> for diagnostics
Diffstat (limited to 'compiler/rustc_ast_passes/src/ast_validation.rs')
| -rw-r--r-- | compiler/rustc_ast_passes/src/ast_validation.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index 837cb805700..cc35b0e288d 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -963,14 +963,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 +1194,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(), }); } } |
