Yeet E0744
This commit is contained in:
parent
f2c500bb43
commit
dd5abb50cc
4 changed files with 8 additions and 15 deletions
|
@ -17,7 +17,7 @@ use rustc_middle::ty::TyCtxt;
|
|||
use rustc_session::parse::feature_err;
|
||||
use rustc_span::{sym, Span, Symbol};
|
||||
|
||||
use crate::errors::{ExprNotAllowedInContext, SkippingConstChecks};
|
||||
use crate::errors::SkippingConstChecks;
|
||||
|
||||
/// An expression that is not *always* legal in a const context.
|
||||
#[derive(Clone, Copy)]
|
||||
|
@ -138,11 +138,10 @@ impl<'tcx> CheckConstVisitor<'tcx> {
|
|||
|
||||
match missing_gates.as_slice() {
|
||||
[] => {
|
||||
tcx.sess.emit_err(ExprNotAllowedInContext {
|
||||
span_bug!(
|
||||
span,
|
||||
expr: expr.name(),
|
||||
context: const_kind.keyword_name(),
|
||||
});
|
||||
"we should not have reached this point, since `.await` is denied earlier"
|
||||
);
|
||||
}
|
||||
|
||||
[missing_primary, ref missing_secondary @ ..] => {
|
||||
|
|
|
@ -1005,15 +1005,6 @@ pub struct FeaturePreviouslyDeclared<'a, 'b> {
|
|||
pub prev_declared: &'b str,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(passes_expr_not_allowed_in_context, code = "E0744")]
|
||||
pub struct ExprNotAllowedInContext<'a> {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub expr: String,
|
||||
pub context: &'a str,
|
||||
}
|
||||
|
||||
pub struct BreakNonLoop<'a> {
|
||||
pub span: Span,
|
||||
pub head: Option<Span>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue