diff options
| author | Jean CASPAR <55629512+JeanCASPAR@users.noreply.github.com> | 2022-08-18 19:30:56 +0200 |
|---|---|---|
| committer | Jean CASPAR <55629512+JeanCASPAR@users.noreply.github.com> | 2022-08-22 19:21:41 +0200 |
| commit | e701c72a631ca443d16d7d37a4ccb584db93ef41 (patch) | |
| tree | 3140a52691c1e734cf5288f0c10bc7d568aa5c09 /compiler/rustc_ast_lowering/src/expr.rs | |
| parent | 51649665917366f605842e9261e77d49fc4e7549 (diff) | |
| download | rust-e701c72a631ca443d16d7d37a4ccb584db93ef41.tar.gz rust-e701c72a631ca443d16d7d37a4ccb584db93ef41.zip | |
Migrate all span_err(...) in ast_lowering to SessionDiagnostic
Diffstat (limited to 'compiler/rustc_ast_lowering/src/expr.rs')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/expr.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs index e470df122b6..61f8c0216f1 100644 --- a/compiler/rustc_ast_lowering/src/expr.rs +++ b/compiler/rustc_ast_lowering/src/expr.rs @@ -1,7 +1,8 @@ use super::errors::{ AsyncGeneratorsNotSupported, AsyncNonMoveClosureNotSupported, AwaitOnlyInAsyncFnAndBlocks, BaseExpressionDoubleDot, ClosureCannotBeStatic, FunctionalRecordUpdateDestructuringAssignemnt, - GeneratorTooManyParameters, RustcBoxAttributeError, UnderscoreExprLhsAssign, + GeneratorTooManyParameters, NotSupportedForLifetimeBinderAsyncClosure, RustcBoxAttributeError, + UnderscoreExprLhsAssign, }; use super::ResolverAstLoweringExt; use super::{ImplTraitContext, LoweringContext, ParamMode, ParenthesizedGenericArgs}; @@ -915,10 +916,7 @@ impl<'hir> LoweringContext<'_, 'hir> { fn_decl_span: Span, ) -> hir::ExprKind<'hir> { if let &ClosureBinder::For { span, .. } = binder { - self.tcx.sess.span_err( - span, - "`for<...>` binders on `async` closures are not currently supported", - ); + self.tcx.sess.emit_err(NotSupportedForLifetimeBinderAsyncClosure { span }); } let (binder_clause, generic_params) = self.lower_closure_binder(binder); |
